MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
Not sure if this is a bug fix or just a behavior change.
The current type-ahead was alphabetical, if you have the items ["A3", "A2", "A1"], you focus "A3" and press "a", the focus goes to "A1" because it's the 1st matching item alphabetically.
This PR switches for a search based on the displayed order (you focus "A2" because it is the 1st matching item below the currently focused one.
IMHO this is a lot more consistent, it's the approach taken by this TreeView for instance.
Nice side-effect, we no longer generate the list of the 1st letter of every item on each keystroke
Now that getNextNavigableItem is cheap it's a lot more efficient that way
Fixes #12826
Not sure if this is a bug fix or just a behavior change. The current type-ahead was alphabetical, if you have the items
["A3", "A2", "A1"]
, you focus"A3"
and press"a"
, the focus goes to"A1"
because it's the 1st matching item alphabetically. This PR switches for a search based on the displayed order (you focus"A2"
because it is the 1st matching item below the currently focused one.IMHO this is a lot more consistent, it's the approach taken by this TreeView for instance.
Nice side-effect, we no longer generate the list of the 1st letter of every item on each keystroke Now that
getNextNavigableItem
is cheap it's a lot more efficient that wayFollow up
Add test in #12811