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

Feature Request: Enter key behavior #173

Closed
rockymeza opened this issue Apr 25, 2017 · 3 comments
Closed

Feature Request: Enter key behavior #173

rockymeza opened this issue Apr 25, 2017 · 3 comments

Comments

@rockymeza
Copy link

I wanted to ask if the following enter key behavior would be something that you would consider accepting, before I try to add it in a PR.

State: an option is highlighted in the menu.
Current behavior: select highlighted item
(no change)

State: user has typed a search, there are search results
Current behavior: nothing
New behavior: selects first result

State: user has typed a search, there are no search results (allowNew=false)
Current behavior: nothing
(no change)

State: user has typed a search, there are no search results (allowNew=true)
Current behavior: nothing
New behavior: creates new selection

State: user has not typed a search
Current behavior: event.preventDefault()
New behavior: allow submitting the form

Thanks!

@ericgio
Copy link
Owner

ericgio commented Apr 25, 2017

State: user has not typed a search
Current behavior: event.preventDefault()
New behavior: allow submitting the form

This should have been addressed with #135. You can set submitFormOnEnter to enable the behavior.

State: user has typed a search, there are search results
Current behavior: nothing
New behavior: selects first result

State: user has typed a search, there are no search results (allowNew=true)
Current behavior: nothing
New behavior: creates new selection

These both seem to address the same behavior, which is auto-highlighting the first (or only) option. This issue is currently being tracked in #77. I've looked into adding support for this and as I recall, it wasn't as easy as it seemed at first glance. #136 tried to add it but only addresses adding the item and not auto-highlighting (which is the trickier piece). If you'd like to take a stab at it, by all means go ahead.

@ericgio
Copy link
Owner

ericgio commented Apr 25, 2017

Closing, since these issues have either been addressed or are already being tracked.

@ericgio ericgio closed this as completed Apr 25, 2017
@rockymeza
Copy link
Author

thanks for the quick response! Thanks for pointing out submitFormOnEnter and I'll take a look at #77 and see if I can knock it out.

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

No branches or pull requests

2 participants