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

[Select] Use onMouseDown as another opening event #9009

Closed
wants to merge 2 commits into from

Conversation

rynti
Copy link

@rynti rynti commented Nov 6, 2017

Fixes #8999.

@@ -345,6 +345,7 @@ class SelectInput extends React.Component<ProvidedProps & Props, State> {
onKeyDown={this.handleKeyDown}
onBlur={this.handleBlur}
onClick={disabled || readOnly ? null : this.handleClick}
Copy link
Member

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?

Copy link
Author

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.

Copy link
Author

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?

Copy link
Member

@oliviertassinari oliviertassinari Nov 6, 2017

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.

@oliviertassinari oliviertassinari added the component: select This is the name of the generic UI component, not the React module! label Nov 6, 2017
@oliviertassinari
Copy link
Member

I'm having a look at this PR :)

@oliviertassinari oliviertassinari self-assigned this Nov 6, 2017
@oliviertassinari oliviertassinari added the PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI label Nov 6, 2017
@oliviertassinari
Copy link
Member

oliviertassinari commented Nov 6, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: select This is the name of the generic UI component, not the React module! PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants