Open stargazer8tw opened 3 years ago
Double-checking that I understood the issue correctly: the problem you're reporting is that the header text disappears when pressing the Test ScrollIntoView
, correct?
Yes, that's correct. The header text disappears when pressing the Test ScrollIntoView
.
Better repro from #21622: https://stackblitz.com/edit/angular-yg9mb5.
We've just run into this ourselves....
I ran into this same issue on latest version of Angular Material...."@angular/material": "^16.1.3". Hope there is an answer. I defaulted to scrolling to just the Expansion Panel as a while. Not any particular element within.
Would be nice to get a fix for this
Reproduction
Steps to reproduce:
Test ScrollIntoView
button.or.
<span class="target">test</span>
insidemat-expansion-panel
tag.mat-expansion-panel
expanded="false"
.elementInsideMatExpansionPanel.scrollIntoView(true)
, e.g.document.querySelector('.bug-target').scrollIntoView(true)
.Expected Behavior
Viewport scrolls to
mat-expansion-panel
withmat-expansion-panel-header
display, and element insidemat-expansion-panel
remains hidden.Actual Behavior
Viewport scrolls to
mat-expansion-panel
and causesmat-expansion-panel-header
x-position changed andmat-expansion-panel-header
is not display.Environment
Workaround
Call
window.scroll
orscrollTo
function, see StackBlitz reproduce example