SamProf / MatBlazor

Material Design components for Blazor and Razor Components
http://www.matblazor.com
MIT License
2.84k stars 386 forks source link

Modal Blocks Scroll When Closed #842

Open Josh-Fry opened 3 years ago

Josh-Fry commented 3 years ago

I am currently working on a project, where I have to switch to another page and switch back to the current page when a modal is closed. I have a bound IsOpen on my dialogs which I switch to false and then navigate to said page which navigates back. However, with this it then does not allow me to scroll anymore on the page.

Also, the reason I have to switch pages is because I am using cards which require a MatButton. However, when I sort said cards within their list. The MatButton's don't move around and therefore link to the wrong card. Looking at the compiled markup, it's down to the Id's not moving or switching. It'd be nice to get both fixed.

But on a more light topic, thank you for your support and creating MatBlazor. It's really nice and simple to use and I appreciate all the effort the dev team is putting in.

stefer commented 3 years ago

This might be related to #829 . Check if .mdc-dialog-scroll-lock is set on the body element. If it is, it is the same bug.

Also, it would be helpful with a little more context. An example would be great, or at least a short description of the layout and components used.

Josh-Fry commented 3 years ago

I am using MatDialog with a bind-IsOpen. I have a NavigationManager.NavigateTo after setting my bind-IsOpen to false and it was locking up the scroll. Found out the hard way in regards to .mdc-dialog-scroll-lock and in my site.scss, I added it in with overflow-y: scroll to fix it.

Also, an update on the other issue. When I sort my cards, it is in fact the menu's attached to the cards don't re-render and are in the same place, even though I have sorted the cards.

RicoSuter commented 3 years ago

I have the same problem and I think this issue is a duplicate of #829