-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Event swallowed when pressing Enter #212
Comments
…he select list wasn't open.
#212. Fixes issue with event being swallowed on Enter keydown
This seems to be re occurring in version 1.1.0. On a form with an onSubmit, the enter causes the dropdown to open, and the onSubmit wont fire. Thanks |
@dcousens youre right, this way fixed in #212, but for some reason on master it was changed. https://github.com/JedWatson/react-select/blob/master/src/Select.js#L454. |
@dcousens Looks like a regression. Could this be reopened?
@sstern6 this link point to the wrong line now, here's one with a fixed git hash: Lines 487 to 494 in 7bc9363
<Enter> is always prevented, so the form is never submitted on <Enter> .
|
Currently pressing enter when the select list isn't open causes the keypress event to be swallowed. Preventing the default behavior of enter when the select list is open seems like the right behavior. However, it prevents things like form submission if the list is closed.
I can submit a pull request with a fix for this. Basically, it just adds an else clause that returns if the select list isn't open.
The text was updated successfully, but these errors were encountered: