Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Product in dropdown clickable in FF/Safari #2839

merged 1 commit into from Aug 25, 2019


Copy link

commented Aug 24, 2019

Fixes #2729

The issue can be recreated outside of woocommerce-admin in FF and Safari, and impacts all Autocomplete components that have a <Button> with DOM nodes for children (i.e., Products, Categories, etc).

Adding the preventDefault within onMouseDown seems to prevent focus from shifting to the children of a <Button>, and prevents triggering the handleFocusOutside by the withFocusOutside HOC.

To recreate issue in CodeSandbox:

In FF or Safari: Clicking on button contents

  • Click the red area
  • Click the blue area in the button
  • In the console, you'll see the following logging: focus, blur, outside, click

IN FF or Safari: Clicking on button

  • Click the red area
  • Click the button (not the blue area)
  • You'll see handleFocusOutside is not called
  • In the console, you'll see the following logging: focus, blur, click


  • I've tested using only a keyboard (no mouse)

Detailed test instructions:

  • In FF or Safari, open Products view and select Show: Single Product
  • Type in a product name
  • Once the search results are shown, click directly on the underlined text
  • The product should be selected
Copy link

left a comment

Thanks @cojennin, this is great! I can confirm it solves the problem and doesn't have side effects in Chrome.

@psealock psealock added the [Type] Fix label Aug 25, 2019

@psealock psealock added this to In Progress PRs (for automation purposes) in wc-admin via automation Aug 25, 2019

@psealock psealock merged commit 664492c into woocommerce:master Aug 25, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed

wc-admin automation moved this from In Progress PRs (for automation purposes) to Done Sprint 23 (August 13 - August 26) Aug 25, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.