This is going to be a somewhat vague question, but I’m hoping to get some insight or hints at where to look for the underlying cause of my problem.
Basically, I’m wondering what would cause a DIV with its own scroll bar/position to reset to the top upon clicking a {{link-to}}
within the DIV that simply updates the query params of the current route. I have to be vague, because my app is quite complicated, so I’m not sure if I can adequately narrow it down to a base JSfiddle or Ember Twiddle But I will try to describe it:
I have one main DIV that I’ve set to the the remaining height allotted to it, via something like height: calc(100vh - 100px);
. This DIV uses flex to create three panels side-by-side, each with their own scrollbar ( overflow-y: scroll;
).
The panel I’m having problems with has basically one contextual component that renders a bunch of other components. It also has {{link-to}}
s that simply update the query parameters of the same route. If I click on any of these links, this panel’s scroll position gets reset to the top. And I can’t figure out why. Even if I create a dummy URL param that doesn’t actually affect any of the components, the scroll position resets.
The weird thing is, if I shrink the browser window enough, so the DIV occupies maybe 150-200px of screen space instead of its usual ~500px when the browser is full screen, then the scroll position won’t reset. The threshold seems to be around 400px.
At this point, I have no idea where to even start debugging this problem. I don’t expect anyone to give me an answer to my specific problem, but what I would like are some possible clues or things I should look at to debug this issue. Could it be a rendering issue (like maybe the DIV is blank for a frame or two, so the scrollbar is reset, before the components are re-rendered?
BTW, I’m on Ember 2.7.x