Repository navigation
ComboBox: Prevent selecting disabled items - #662
Open
nurullahturkoglu wants to merge 2 commits into
Open
nurullahturkoglu wants to merge 2 commits into
nurullahturkoglu wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (75.00%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## dev #662 +/- ##
==========================================
+ Coverage 67.93% 68.07% +0.14%
==========================================
Files 118 118
Lines 8616 8618 +2
Branches 1516 1517 +1
==========================================
+ Hits 5853 5867 +14
+ Misses 2233 2221 -12
Partials 530 530 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
Closes #659
Disabled
MudComboBoxItems could still end up selected. In the browser the item's CSS setspointer-events: none, so a mouse click never reaches it. In Strict mode, though, typing a disabled item's text and leaving the field selected it.HandleOnClickdidn't checkDisabledeither, which is what the ignored test caught under bUnit.HandleOnClicknow returns early for a disabled item, so neither the selection nor itsOnClickruns.ToggleOptionignores disabled items too, so its other callers are covered. The Strict blur lookup skips disabled items, so the typed text is handled like any other text that doesn't match: it's cleared, or the previous value is restored.I removed the
[Ignore]fromComboBox_DisabledItemShouldNotBeSelectableand added tests forOnClick, multi selection, a directToggleOptioncall and the Strict blur case. They fail without the fix, anddotnet test -c Release -f net11.0passes all 409 tests.I also checked it on the docs server (Chrome, macOS) with an item in the first example temporarily disabled and
Strictturned on. Before, typing "Bar" and leaving the field set Value to Bar. After, the field is cleared and the value stays empty. Typing an enabled item still selects it.Before:

After:
