Pressing 'enter' key on Select component does not automatically select an item.
See original GitHub issueWhile having a Select component and the drop down menu is active, pressing the ‘enter’ key (without selecting an item) causes the drop down menu to close without passing an item to Select’s field.
Expected Behavior
As a user when the drop down list is active and I haven’t chosen an item from the list I expect to press enter and have the first item automatically selected. The existing functionality with arrow keys should continue to work.
Actual Behavior
Pressing enter just closes the active dropdown menu without passing an item.
URL, screen shot, or Codepen exhibiting the issue
https://codepen.io/Segovia/pen/zdBbex?&editors=0010
Steps to Reproduce
- Open the drop down menu
- Press enter without choosing an item
- The active list closes without a selected item.
Your Environment
- Grommet version: 1.4.1
- Browser Name and version: 60.0.3112.78 (Official Build) (64-bit)
- Operating System and version (desktop or mobile): 4.12.3-1-ARCH
There is the onEnter
function, that can be found here that handles that specific behavior. I believe that pressing enter should:
- Select the item that the user selected (with arrow keys).
- Select the first item on the list/drop down menu if none was selected by the user.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
react-select Creatable: override default behavior upon ...
Currently whenever the user types something in and presses Enter key, it gets added as a new option. Is there a way to...
Read more >Solved: ComboBox automatically select item on key press
Hello, I have a combobox that once you enter the control, sets the .DroppedDown property to True so it will expand the box...
Read more >Keyboard-navigable JavaScript widgets - Accessibility | MDN
When set to -1 , the element becomes focusable by script, but it does not become part of the keyboard focus order.
Read more >Select | Quasar Framework
In case you are looking for a dropdown “button” instead of “input” use Button Dropdown instead. QSelect API. QSelect ...
Read more >Understanding Success Criterion 3.2.2 - W3C
Clicking on links or tabs in a tab control is activating the control, not changing ... H84: Using a button with a select...
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
@dgennetten I am thinking that I did not make a good job on explaining the second bullet. Here is a more detailed explanation:
This does not happen here (user presses enter and the item on top does not become selected).
Thank you for your response, @karatechops .