MudScrollManager: fix scroll lock for touch devices#7472
MudScrollManager: fix scroll lock for touch devices#7472henon merged 1 commit intoMudBlazor:devfrom ric-ros:feature/LockScrollMudDialog
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## dev #7472 +/- ##
==========================================
- Coverage 90.61% 90.60% -0.02%
==========================================
Files 427 427
Lines 15199 15206 +7
==========================================
+ Hits 13773 13777 +4
- Misses 1426 1429 +3
☔ View full report in Codecov by Sentry. |
|
@henon do you know if it's possible to unit test scrolling with bUnit? If yes, we definitely should ask it from author then. |
|
I did change the ScrollManager js calls from OnAfterRenderAsync because was calling the same multiple times. They'll be called only if required when the value Visible change. Is failing DebouncedTextFieldRerenderTest but I don't know why. In local it passes in 3s |
|
I will reopen a new PR with cleaner commits. |
|
The commits don't matter, in the end we'll squash everything anyway so you can as well reopen this. As for testing, AFAIK the only way to test this is to check if the overflow css attribute is applied to the correct container. There should be Dialog tests that check similar things. You can print the html with console writeline to see the html structure that gets constructed by the test case. Does this help? |
Yeah, you can commit as much as you want. There is usually no reason to open new PR since you can do with your branch whatever you want: squash, edit commit history, force push etc.
What you just did i.e. moving the js calls from |
|
|
Thank you guys! |
|
Just noticed that most of the bugs were just because of the js functions.. for now I would go easy on that to not to risk to make things worse. So far, the only one that I've noticed not working as expected is mudDrawer. Does not block anything. |
|
Do I need to change description/PR ? |
|
Sure, what would be a better description of the change? So you think this ready to merge? |
Is basically a small enhancement on the javascript functions "lockScroll" and "unlockScroll".
Yes, I think so. |
Co-authored-by: Riccardo Rossetti <[email protected]>
LockScroll Parameter was missing for MudDialog. As seen on Material dialog, the dialog should be able to block the background.
To make it work on touch devices, mudScrollManager.js has been slightly modified.
Description
Resolves #7454
Resolves #6108
added LockScroll parameter in DialogOptions for MudDialogHow Has This Been Tested?
Manually.
Example has been added in Docs.
Types of changes
Checklist:
dev).