MudSelect: Enhance Keyboard Searching#10433
Conversation
…d initiates a search - Cycle through matches - Multi-character search - Configurable search debounce
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #10433 +/- ##
==========================================
- Coverage 91.57% 91.56% -0.01%
==========================================
Files 426 426
Lines 13311 13334 +23
Branches 2567 2571 +4
==========================================
+ Hits 12189 12209 +20
- Misses 548 549 +1
- Partials 574 576 +2 ☔ View full report in Codecov by Sentry. |
danielchalmers
left a comment
There was a problem hiding this comment.
Few notes:
I don't think a SearchContext object is necessary if it's only initialized once and has two members.
I noticed if you get a letter wrong (in this case "Veru" instead of "Verm") it'll go to the next one:
Recording.2024-12-14.092320.mp4
If you spam the keyboard the page will lag for a few seconds
If you type a key there is a new delay because of the debounce. The selection should begin immediately on keydown, not after the debounce. The debounce property should also probably have a more specific name. It should also be more like 1s which I believe is the browser default (for accessibility)
The popover list should not appear after typing (to match native select behavior)
Yes, once a string search fails, there's a fallback to the character search and the standard cycling through results apply. That's how typing T -> T does Tennessee -> Texas add there are no valid results for TT @danielchalmers would you like it to instead ignore the newly entered invalid character and search for Ver again (dropping the U) |
|
I think every invalid character after a string of valid characters should be ignored and it shouldn't perform a new search until after the debounce.
I believe that's the behavior of the native |
…com/Anu6is/MudBlazor into 7638-MudSelect-KeyboardDrivenSearch
|
I can't use keyboard shortcuts (including search) at all anymore on the SelectFocusAndTypeTest |
Just pulled this down on my work machine.... all originally documented shortcuts and the updates work as expected. |
danielchalmers
left a comment
There was a problem hiding this comment.
Working great on a different PC!
|
Will want to wait on @mckaragoz |
Will look at in 2 days :) |
henon
left a comment
There was a problem hiding this comment.
@mckaragoz will you look at this shortly or shall we just merge it?
|
@Anu6is yes users use select item that hold null values. They already opened some issues about highlighted items when the value is null. |
|
All the explained features are very smart. But i have 2 arguments:
|
This is a good point. Some might prefer single character search. We might have to make it configurable.
I checked with Native HTML Select and it seems to behave exactly like you prefer. Another valid point, I guess. But I can also see users wanting to have the behavior @Anu6is implemented in this PR. So I guess we could add switches for both to The question is, can it be switched easily without adding too much complexity? |
|
@mckaragoz @henon Opening the select on any key press was to facilitate the search as the list of items is only available once rendered after opening. I can look into rendering the component in code instead of rendering in the UI. |
- allow searching without opening the popover
|
|
Implemented changes suggested by @mckaragoz |
That's cool.
No need to dive deep into this. This technical limitation is enough a reason for the current behavior. |






Description
Enhances the use of the MudSelect when using the keyboard only
QuickSearchIntervalparameter to customize sensitivity (defaults to 0 - single character search)Resolves #7638
How Has This Been Tested?
Unit tests and visually via docs
Type of Changes
Checklist
dev).