-
While developing a more complex page, I found the following quirk and am interested in preventing it from happening. Any help is much appreciated. A reproducible example follows a short summary. Suppose there is a plot that depends on an input range, and the input range is further down the page than the plot. If you scroll down to focus on and adjust the input range, the page jumps up towards the plot by an amount I cannot determine. If the plot and the input range are well separated, the focus does not return to the plot; more lorem ipsum is sufficient to see this. I would prefer the page to not change focus at all. Thanks in advance for your help. Here's a reproducible example.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hm, this does not happen in Firefox. Only in Safari. |
Beta Was this translation helpful? Give feedback.
-
Would this be better moved to an Issue? Here's a live version https://roualdes.github.io/lecturenotes/poisson, more complicated than the minimal reproducible example above but with the same issue. It appears to be a WebKit issue, since all browsers on iOS suffer the same issue. |
Beta Was this translation helpful? Give feedback.
When a node is refreshed, framework removes it from the DOM and replaces it with the new version. Webkit reflows the page in-between for some reason, and suddenly the bottom of the page is in the viewport, which makes it scroll down.
You can mitigate the issue by adding a div at the bottom of the page:
alternatively, a style on the body with e.g.
body {margin-bottom: 500px}
. (I'm not sure about the size we want, btw; should be a lot.)In both cases it adds some white space at the bottom, which might not be ideal. Maybe we could find a better solution that suits everyone and add it to framework?