ParameterState: Fix when subscribing only to EventCallback #8457
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
This fixes an interesting problem when you subscribe only to
EventCallback
and modify the child, for example you have content collapsed and you want to expand it via public method likeToggleAsync
, the content would not expand, when it should.This problem was found here: #8446
Consider this as example:
Note that when you click on expansion, you are triggering inner child toggle method
Before
After
The line in unit tests that specifically tests that this moment is covered:
MudBlazor/src/MudBlazor.UnitTests/State/ParameterStateUsageTests.cs
Line 235 in 16d2339
and
MudBlazor/src/MudBlazor.UnitTests/State/ParameterStateUsageTests.cs
Line 250 in 16d2339
aka the content must show when clicked and state should correspond that it's opened, before the fix this would fail.
How Has This Been Tested?
New bUnit tests that took me few hours to make...
Types of changes
Checklist:
dev
).