MudDrawer: Make Temporary Drawer non-responsive#10095
Conversation
… by their breakpoint
|
Actually not sure if this is a breaking change. This is how I would expect it to work when not responsive. But could be a change for someone that expects the Breakpoints to control their non-response drawer? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #10095 +/- ##
=======================================
Coverage 91.16% 91.16%
=======================================
Files 411 411
Lines 12468 12467 -1
Branches 2420 2420
=======================================
Hits 11366 11366
Misses 557 557
+ Partials 545 544 -1 ☔ View full report in Codecov by Sentry. |
|
Hi. Thanks for the PR. I guess your change makes sense for |
|
For me the docs about temporary drawers are unclear. It being above all other content is clear.
Then later in the docs of other drawers the word So I am not sure if it is correct to completely remove breakpoint update notification from temporary drawers. Or am I getting it all wrong? |
Honestly, for clarification, we would need @tungi52, but I don't think we’ll get a reply. I refactored most of the drawer, but I never figured out how the |
|
I see. I guess we should then clarify this in the documentation. Merging this in v8 is perfect, we can clarify in the migration guide that the behavior of the Temporary Drawer has now been officially defined to be non-responsive. Text for the v8 migration guide:
@Nickztar can you update the documentation in this PR so it is perfectly clear? Then we can merge. |
|
If anyone wants it to be responsive we can always add another parameter to |
|
Sounds good. I will try to add some documentation to make it clearer to users what and what isn't responsive. Adding a Responsive parameter would be very simple aswell since the check for using the breakpoints is the same method for initial rendering as it is for changes. 👍🏼 |
|
@henon Guess this clarifies it a bit. Let me know if you have any ideas on other parts where it can be clarified. |
|
@Nickztar Check it out, I modified the text of all drawer variants. |
|
Looks great. Much clearer how the other types work aswell! |
|
LGTM, @henon feel free to merge. |
|
Thanks @Nickztar! |
|
Added to the v8 migration guide at #9953 |
Co-authored-by: Meinrad Recheis <meinrad.recheis@gmail.com>
Co-authored-by: Meinrad Recheis <meinrad.recheis@gmail.com>
Description
Not setting a breakpoint with a Temporary drawer as auto-open (_open being true on initial render) should still open on smaller devices. In a larger window this opens automatically, but when scaled down. It doesn't actually open, due to the immediate response from ViewportService.
Possible work-arounds:
Setting the breakpoint parameter on drawer to something like Breakpoint.Xs does give expected result but does feel like a weird problem since the breakpoint parameter is documented to only be related to resposive drawers.
Other solutions considered:
Setting breakpoint to
Breakpoint.Alwaysbut then_openisnt respected (So having it NOT auto open doesnt work. It always opens). Another solution that might have been possible isBreakpoint.None, but then we are back at not respecting_openfor auto-opening.A short example with some notes in TryMudblazor (https://try.mudblazor.com/snippet/caGobEGTREtbcRBn)
How Has This Been Tested?
A new unit test has been added, which checks to make sure that for all the breakpoints returned from Viewport service, the initial state set in the drawer is kept, if the drawer is not response/mini.
Type of Changes
Checklist
dev).