MudAutocomplete: Fix Text coersion on Tab key (OnBlur or CloseMenu)#10074
Merged
henon merged 5 commits intoMudBlazor:devfrom Oct 23, 2024
Merged
MudAutocomplete: Fix Text coersion on Tab key (OnBlur or CloseMenu)#10074henon merged 5 commits intoMudBlazor:devfrom
henon merged 5 commits intoMudBlazor:devfrom
Conversation
… method, now calling CloseMenuAsync() and CoerceTextToValueAsync() correctly (even on blur). - Fixed CoerceTextToValueAsync() to skip coersion if ResetValueOnEmptyText is true.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #10074 +/- ##
=======================================
Coverage 91.13% 91.14%
=======================================
Files 410 411 +1
Lines 12462 12484 +22
Branches 2419 2423 +4
=======================================
+ Hits 11357 11378 +21
Misses 560 560
- Partials 545 546 +1 ☔ View full report in Codecov by Sentry. |
Member
|
cc @vernou (can't add in review for some reason) |
vernou
suggested changes
Oct 22, 2024
danielchalmers
approved these changes
Oct 22, 2024
…etValueOnEmptyText check.
…azor test component.
vernou
reviewed
Oct 22, 2024
vernou
approved these changes
Oct 22, 2024
…azor test component, take 2.
vernou
approved these changes
Oct 23, 2024
Contributor
Fixed. He wasn't in the MudBlazor org contribution team yet. |
Contributor
|
Thanks @HClausing! |
Member
Author
Thanks for merging. I'm happy to be back on contributing. |
LLauter
pushed a commit
to cannellamedia/MudBlazor
that referenced
this pull request
Dec 16, 2024
This was referenced Aug 18, 2025
This was referenced Oct 5, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Related issues / PRs: #3824, #3825, #8914
The component was invalid closing the Menu on Tab Key Down, just by setting Open = false. By this way never call the
CoerceTextToValueAsync()method. Instead, now it's changed toawait CloseMenuAsync();.Another unexpected behavior that appeared after this fix is about combining
ResetValueOnEmptyTextandCoerceText. TheCoerceTextwas forcing the last valid value to Text even with empty input. NowValueandTextare set to null on empty text.How Has This Been Tested?
AutocompleteTextCoercionOnTabKeyTest()andAutocompleteTextCoercionAndResetIfEmptyTextTest.Type of Changes
Fix for Close Menu called on
OnInputKeyDownAsyncby Tab key, now calling CloseMenuAsync() and CoerceTextToValueAsync() correctly (even on blur), instead just settingsOpen = false;Fixed
CoerceTextToValueAsync()to skip coersion ifResetValueOnEmptyText = trueandText = string.Empty.Checklist
dev).