davidtheclark / react-aria-menubutton

A fully accessible, easily themeable, React-powered menu button
https://davidtheclark.github.io/react-aria-menubutton/demo
MIT License
456 stars 78 forks source link

Select number value when a user begins typing while the dropdown is open #79

Open heathercodes opened 6 years ago

heathercodes commented 6 years ago

While this library is fantastic for words, when dropdown has numbers as the dropdown values and the user types a number value to search for it, the dropdown does not highlight that number.

e.g. in a dropdown list of birth years [2004... 1932], when the dropdown is open and the user types "1984", that value is not highlighted.

The reason for this may be addressed elsewhere, but wanted to file an issue to ask for clarification on this.

davidtheclark commented 6 years ago

I think the only reason for this is that it hasn't been implemented yet. Over in the dependency focus-group, I limited the keyboard listeners to letter keys: https://github.com/davidtheclark/focus-group/blob/b9de0536aa9b065b110a3880650f83e925ceef13/index.js#L133-L134 I wanted to avoid dealing with all the non-letter keys, but didn't think about numbers! So I think we'd need to make a change in focus-group, then update that dependency here.

heathercodes commented 6 years ago

Thanks for the response David! It would be great to have this functionality on our app as we use a lot of number dropdowns and are trying to be AA accessible.