Skip to content

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.

1 participant