-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
MudAutocomplete: Fix Text coersion on Tab key (OnBlur or CloseMenu) #10074
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
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. |
|
cc @vernou (can't add in review for some reason) |
…etValueOnEmptyText check.
…azor test component.
…azor test component, take 2.
Fixed. He wasn't in the MudBlazor org contribution team yet. |
|
Thanks @HClausing! |
Thanks for merging. I'm happy to be back on contributing. |
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).