Reputation: 31
When ever I click on the close button in mat-dialog, the scroll top position automatically reset and move to top. I am using angular material 6.1.0 version. This is happening only in IE11.
Upvotes: 3
Views: 2427
Reputation: 1099
I was having the same issue with Angular material 7.3.2. When the dialog close the page scroll up. unless if I click on an element in the page then open the dialog. later, I found out that the issue is happening because there is a focused element at the top of the page (navigation button) and clicking on an element on the page removes the focus from that button.
so I added autoFocus: true
and restoreFocus: false
to the config object of the matdialog open method
Upvotes: 5