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

[SelectUnstyled] Implement text navigation #31012

Closed
michaldudak opened this issue Feb 10, 2022 · 2 comments · Fixed by #31940
Closed

[SelectUnstyled] Implement text navigation #31012

michaldudak opened this issue Feb 10, 2022 · 2 comments · Fixed by #31940
Labels
component: select This is the name of the generic UI component, not the React module! package: base-ui Specific to @mui/base

Comments

@michaldudak
Copy link
Member

Support text navigation (highlighting options that begin with typed characters). This works in native selects and in Material UI's one (implemented in #8191).

@michaldudak michaldudak added component: select This is the name of the generic UI component, not the React module! package: base-ui Specific to @mui/base labels Feb 10, 2022
@michaldudak michaldudak self-assigned this Feb 10, 2022
@michaldudak michaldudak moved this to To do 📃 in Base UI Alpha Feb 10, 2022
@michaldudak michaldudak changed the title [SelectUnstyled] [SelectUnstyled] Implement text navigation Feb 10, 2022
@ivan-ngchakming
Copy link
Contributor

ivan-ngchakming commented Mar 18, 2022

I will work on this issue.
I am not sure if this is claimed (the issue seem to be assigned to you)? If not, I think I'd like to work on this issue.

I have looked over the code and I think this is what needs to be done:

  1. Add textCriteriaRef to track user inputs in useListbox hook (same as textCriteriaRef in MenuList)
  2. implement logic (to produce same behavior as [MenuList] Add text keyboard focus navigation #15495) to determine which option should be highlighted, which can be done by either
  3. update unit test for defaultListboxReducer
  4. add unit test for useListbox and integration test for SelectUnstyled

did I miss anything?

@michaldudak
Copy link
Member Author

Hi @ivan-ngchakming, you're free to work on this.
It's a pretty good breakdown, however, one important difference between useListbox and MenuList is that useListbox works on objects (e.g. options can be arbitrary objects), whereas MenuList works on its children's DOM nodes. useListbox will need a function that can convert an object option into its string representation.

@michaldudak michaldudak moved this from To do 📃 to In progress 🛠 in Base UI Alpha Mar 29, 2022
Repository owner moved this from In progress 🛠 to Done 🎉 in Base UI Alpha Apr 6, 2022
@michaldudak michaldudak removed their assignment May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: select This is the name of the generic UI component, not the React module! package: base-ui Specific to @mui/base
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants