Select first option on Tab/Enter even when it's not matched for the hint
See original GitHub issueVersion
3.4.5
Steps to reproduce
- Go to the examples page
- Click in the input field for the first one, the Basic Example.
- Type “ask”.
- Note that the menu shows two matches: “Alaska” and “Nebraska”.
- Hit <kbd>Tab</kbd>.
Expected Behavior
The first option “Alaska” becomes selected since it matches what the user typed.
Actual Behavior
Nothing is selected.
Miscellaneous
At first, I assumed it was caused by my custom menu renderer so I asked on Stack Overflow, but someone pointed out that getHintText()
specifically requires the match to be at the start of the label. Perhaps a feature to override this behavior is preferable to changing it for everyone.
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
How do I select only the first option matching a value using ...
You can use :first selector here which selects the first matched DOM element. $('.countryField').find('option[value="233"]:first').
Read more >SciFinder (Classic) Guide - Chemistry
If it finds an exact match, it displays only that compound, and no others. For example, if you search for "Gallopamil" it will...
Read more >Frequently Asked Questions - Galaxy Training!
Click on the User menu at the top and go to Active Interactive Tools and locate the JupyterLab instance you started. Click on...
Read more >Stickies User Guide for Mac - Apple Support
Learn how to use Stickies on your Mac to keep notes, lists, and even pictures in ... Add a list: Press Option-Tab, enter...
Read more >Language Options - RAD Studio - Embarcadero DocWiki
Tools > Options > User Interface > Editor > Language and click on Options tab. ... If this option is not checked, you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Man, I haven’t used Google’s site in forever. 😃 In Chrome at least, typing a domain in your history into the address bar hints the first match in the bar itself. Hitting enter navigates to that URL. I’m fine with only <kbd>Enter</kbd> triggering the navigation, but I don’t think that matters since that’s not how the component is designed to function.
Since I have the options in my state, all I need to do is capture <kbd>Enter</kbd> when the user is in the input. That seems straight-forward enough without actually changing any of the code. Sorry, I got hung up on having to use <kbd>Tab</kbd> originally that I didn’t think of this more obvious solution until just now.
Thanks so much for your help!
Good point. 😉