Skip to content
This repository has been archived by the owner on Jul 19, 2019. It is now read-only.

[changed] Prevent Return in menu from submitting surrounding form #92

Merged

Conversation

CMTegner
Copy link
Collaborator

@CMTegner CMTegner commented Apr 6, 2016

The default behaviour of hitting Return in a <input type=text> is to submit
the immediate surrounding form. I would hazard a guess that this isn't the
expected result when using Return to select an item in the autocomplete
menu. Since we don't expose the event object to the consumer via onSelect we
need to make sure we're making the most sensible choice by default.

Hitting Return a second time (after the menu has closed itself) will
result in the default, expected behaviour.

The default behaviour of hitting `Return` in a `<input type=text>` is to submit
the immediate surrounding form. I would hazard a guess that this isn't the
expected result when using `Return` to select an item in the autocomplete
menu. Since we don't expose the event object to the consumer via `onSelect` we
need to make sure we're making the most sensible choice by default.

Hitting `Return` a second time (after the menu has closed itself) will
result in the default, expected behaviour.
@bfink13
Copy link
Contributor

bfink13 commented Apr 7, 2016

Looks good!

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

Successfully merging this pull request may close these issues.

3 participants