Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Selecting an suggested item using Enter submits the form #49

Closed
janmyler opened this issue Sep 28, 2015 · 3 comments
Closed

Selecting an suggested item using Enter submits the form #49

janmyler opened this issue Sep 28, 2015 · 3 comments

Comments

@janmyler
Copy link

When the component lives in a form and one of the suggested items is selected using keyboard (arrows + hitting enter), the form is submitted.

From the source code I see you didn't include event.preventDefault() probably on purpose? Could this be at least configurable by props? There's no other way how to prevent this as you don't pass the event to the onSuggestSelect method.

@ro-ka
Copy link
Contributor

ro-ka commented Sep 29, 2015

Does it make sense to prevent always? Is it a use case to submit on select via enter? Sounds more like a bug, because it does not submit on other select modes (e.g. click) which is inconsistent.

@ro-ka ro-ka closed this as completed in dda86a1 Sep 29, 2015
@ro-ka
Copy link
Contributor

ro-ka commented Sep 29, 2015

Released with 1.10.0. Thanks for reporting!

@janmyler
Copy link
Author

@ro-ka, thanks for a quick fix!

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

No branches or pull requests

2 participants