-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[Select] Use onMouseDown as another opening event #9009
Conversation
src/Select/SelectInput.js
Outdated
@@ -345,6 +345,7 @@ class SelectInput extends React.Component<ProvidedProps & Props, State> { | |||
onKeyDown={this.handleKeyDown} | |||
onBlur={this.handleBlur} | |||
onClick={disabled || readOnly ? null : this.handleClick} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Originally I thought we needed it for handling the keyboard events, but just realized that this is already explicitly handled by the onKeyDown event. Also tested without the onClick on mobile and desktop, and seems to still work without it.
I fixed this in the second commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to fix the unit tests though. This got me thinking that maybe we should keep the second handler for testing's sake. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can update the tests too. The tests need to be as close as possible to what people use in the browser.
I'm having a look at this PR :) |
I'm sorry, this is definitely not a simple issue to fix. It's surfacing another issue with how the focus is handled. It's will require a rethink of how it's done. It's certainly not a one-line change. |
Fixes #8999.