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

Update AutocompleteCore.js - Tab key also fires onSubmit #120

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jhuddle
Copy link

@jhuddle jhuddle commented Jan 11, 2021

If I want to select a result with the keyboard when the autocomplete element appears in the context of a <form>, pressing Enter to select it is undesirable, as the browser will try to submit the whole form; selecting from the list with Tab would be the idiomatic alternative, and this updates the input field as expected - but does not currently fire onSubmit as pressing Enter does, which means I can't as easily validate the selection/propagate the selected result. I have found that this small modification saves a lot of bother!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant