Answer the question
In order to leave comments, you need to log in
How to scroll up the page until the material dialog closes or close the dialog before switching to another route?
I have implemented scrolling the page up when switching from one route to another, everything works fine until I go to the route via the link located in the material dialog.
It turned out that the material dialog sets the class "cdk-global-scrollblock" to the html tag, which in turn sets the styles position: fixed; width: 100% in which the elementary window.scroll does not work ... at all ...
But the funny thing is that this state remains for quite a long time after the dialog is closed, so long that from time to time we have time to switch to another route and naturally stay in the same place.
I tried to remove the "cdk-global-scrollblock" class through beforeClosed and scroll in it, and I saw this picture
I scroll the page down, open the dialog, close it, the page scrolls up and immediately goes down again.
I just need to disable this behavior. I will be glad to advice
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question