You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: add keyboard support to FluentAutoComplete in single-mode to delete selection #3844
Once you have made a selection there is no way to unselect the selection via keyboard again. The old way allowed to remove the item via backspace key or via a click on the x on the selected item or when the same item has been selected again. None of these ways is possible anymore when using single-mode.
🤔 Expected Behavior
I expect the component to remove the selection via backspace, delete and when the user unselects the same item again.
😯 Current Behavior
None of these way is possible anymore when using single-mode.
Maybe we remove the invalid text when focus is lost from the input?
This isn't as simple as it sounds because the control will lose it'S focus when you navigate through the elements in the list by keyboard or when you try to click at one.
Ok, i think i got most things covered, only the following use case i need to work out:
When a user selected a value, typed something extra after the value or typed invalid words.
In the current case it will jump back to that last selected value. But maybe it would be better to clear the selected value when the value text no longer matches the last selected value.
When a user selected a value, typed something extra after the value or typed invalid words.
In the current case it will jump back to that last selected value.
And what about if a user deletes some chars from the beginning of the value? Can the last selected value than still be determined? Think going back to a blank solves a lot of ambiguity errors that can come of this
And what about if a user deletes some chars from the beginning of the value? Can the last selected value than still be determined? Think going back to a blank solves a lot of ambiguity errors that can come of this
As long as the text matches the first item in the list it will reselect the item yes.
I will continue working on it this weekend, as i did not have the time yet to do so.
Tyme-Bleyaert No rush! I just kicked off the build for the v4.12.0 packages. You PR can go into the next release (which we could de as early as next week if we want to)
Looking into that right now. No idea why that happened.
looks like the site returns the Microsoft.FluentUI.AspNetCore.Components.Assets file as a js file instead of the Microsoft.FluentUI.AspNetCore.Components.lib.module.js from the dist folder. That's actually funny 😄
Ok, I encountered some more things I'm not entirely happy with.
Most of them I already fixed, but for instance when we have a disabled option as first result in the search results. When the users presses tab or enter, we should select the first non disabled result no? eg:
Here I would expect "Austria" to be selected when pressing enter or tab.
Also I'm not sure as to why in ListComponentBase<TOption>, OnSelectedItemChangedHandlerAsync(TOption? item) prevents null value when multiple is disabled. Does this not prevent us from clearing a selection back to its default value?
Activity
MarvinKlein1508 commentedon May 28, 2025
Steven Rasmussen (@StevenRasmussen) do you see any easy way to prevent stuff like this as well?
I cannot tell you how often I have to tell my users that it is not a valid input here.
StevenRasmussen commentedon May 28, 2025
Maybe we remove the invalid text when focus is lost from the input?
vnbaaij commentedon May 29, 2025
I've labeled this with 'community contribution' as I expect (hope) you to come up with a solution (and a PR) for this
MarvinKlein1508 commentedon May 29, 2025
This isn't as simple as it sounds because the control will lose it'S focus when you navigate through the elements in the list by keyboard or when you try to click at one.
Tyme-Bleyaert commentedon Jun 4, 2025
I would like to give this a crack if you guys don't mind.
vnbaaij commentedon Jun 4, 2025
Tyme-Bleyaert Absolutely. Have a go at it. I'll assign this to you
Tyme-Bleyaert commentedon Jun 4, 2025
Ok, i think i got most things covered, only the following use case i need to work out:
When a user selected a value, typed something extra after the value or typed invalid words.
In the current case it will jump back to that last selected value. But maybe it would be better to clear the selected value when the value text no longer matches the last selected value.
What do you guys think?
MarvinKlein1508 commentedon Jun 4, 2025
I agree. What about you Vincent Baaij (@vnbaaij) ?
vnbaaij commentedon Jun 4, 2025
And what about if a user deletes some chars from the beginning of the value? Can the last selected value than still be determined? Think going back to a blank solves a lot of ambiguity errors that can come of this
Tyme-Bleyaert commentedon Jun 6, 2025
As long as the text matches the first item in the list it will reselect the item yes.
I will continue working on it this weekend, as i did not have the time yet to do so.
vnbaaij commentedon Jun 6, 2025
Tyme-Bleyaert No rush! I just kicked off the build for the v4.12.0 packages. You PR can go into the next release (which we could de as early as next week if we want to)
Tyme-Bleyaert commentedon Jun 6, 2025
So that's why the documentation site is down?
vnbaaij commentedon Jun 6, 2025
Looking into that right now. No idea why that happened.
Tyme-Bleyaert commentedon Jun 6, 2025
looks like the site returns the
Microsoft.FluentUI.AspNetCore.Components.Assetsfile as a js file instead of theMicrosoft.FluentUI.AspNetCore.Components.lib.module.jsfrom the dist folder. That's actually funny 😄vnbaaij commentedon Jun 6, 2025
Yes, saw that too. Really weird. Maybe a .NET 10 preview issue
Tyme-Bleyaert commentedon Jun 9, 2025
Ok, I encountered some more things I'm not entirely happy with.
Most of them I already fixed, but for instance when we have a disabled option as first result in the search results. When the users presses tab or enter, we should select the first non disabled result no? eg:
Here I would expect "Austria" to be selected when pressing enter or tab.
Also I'm not sure as to why in
ListComponentBase<TOption>,OnSelectedItemChangedHandlerAsync(TOption? item)prevents null value when multiple is disabled. Does this not prevent us from clearing a selection back to its default value?vnbaaij commentedon Jun 9, 2025
Maybe Denis Voituron (@dvoituron) can answer that one?
dvoituron commentedon Jun 17, 2025
This keyboard support will be included in the next Release. See #3930