question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Select component should capture keyboard input

See original GitHub issue

I believe the select component should mimic the native HTML select component. ~A core aspect of this is allowing the user to select an option with a keypress and using arrow keys to move up and down the list of options. Selection is done by pressing space or enter.~ The component doesn’t let you scroll to the option by pressing the letter key associated with the option.

Example: https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
bdesouzacommented, Jul 9, 2020

@ShimiSun - You’re right! It actually does mimic the native HTML element for the arrow keys and the select.

I think where it breaks from the native HTML Select is when I do a keypress. If I have a list of States and hit the letter C, it should take me to the first option with the letter C.

0reactions
jcfilbencommented, Jul 12, 2021

As mentioned in #5264 this issue has been fixed. Here is a video demonstrating navigating the select with the keyboard, pressing the ‘m’ and then ‘z’ keys and the select correctly scrolling to both of them. Jul-12-2021 10-16-06

Read more comments on GitHub >

github_iconTop Results From Across the Web

<select>: The HTML Select element - HTML - MDN Web Docs
Selecting multiple options · Focusing on the <select> element (e.g. using Tab ). · Holding down the Ctrl key then using the Up...
Read more >
Capture key press without placing an input element on the ...
How to capture key press, e.g., Ctrl+Z, without placing an input element on the page in JavaScript? Seems that in IE, keypress and...
Read more >
Implement Keyboard Events in React - Pluralsight
You can listen for keydown and keyup events, which indicate when a user presses or releases keyboard keys.
Read more >
How to Handle Keyboard Input Events in React TypeScript ...
When dealing with user interactions, you often need to handle some user events like mouse clicks, keyboard input, etc.
Read more >
Building accessible Select component in React - Medium
Select components are everywhere on the internet. ... On Windows, you can turn on Narrator using Windows Key + Ctrl + Enter.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found