-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[TreeView] Use the order in which the items are displayed for type-ahead #12827
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
flaviendelangle
added
bug 🐛
Something doesn't work
component: tree view
TreeView, TreeItem. This is the name of the generic UI component, not the React module!
labels
Apr 18, 2024
flaviendelangle
force-pushed
the
type-ahead-fix
branch
from
April 18, 2024 09:36
20a23e3
to
9daff8b
Compare
Deploy preview: https://deploy-preview-12827--material-ui-x.netlify.app/ |
flaviendelangle
requested review from
LukasTy,
noraleonte and
michelengelen
and removed request for
LukasTy
April 18, 2024 10:00
flaviendelangle
changed the title
[TreeView] Fix type-ahead
[TreeView] Use the order in which the items are displayed for type-ahead
Apr 18, 2024
michelengelen
approved these changes
Apr 18, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit only ... LGTM
...ee-view/src/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.ts
Show resolved
Hide resolved
...ee-view/src/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.ts
Outdated
Show resolved
Hide resolved
…Navigation/useTreeViewKeyboardNavigation.ts Co-authored-by: Michel Engelen <[email protected]> Signed-off-by: Flavien DELANGLE <[email protected]>
DungTiger
pushed a commit
to DungTiger/mui-x
that referenced
this pull request
Jul 23, 2024
…ead (mui#12827) Signed-off-by: Flavien DELANGLE <[email protected]> Co-authored-by: Michel Engelen <[email protected]>
thomasmoon
pushed a commit
to thomasmoon/mui-x
that referenced
this pull request
Sep 9, 2024
…ead (mui#12827) Signed-off-by: Flavien DELANGLE <[email protected]> Co-authored-by: Michel Engelen <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug 🐛
Something doesn't work
component: tree view
TreeView, TreeItem. This is the name of the generic UI component, not the React module!
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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