In some cases browsers choose bad element for vertical scroll, when URL-hash in an anchor has passed. For example overflow:hidden
element may choose.
I want to know, how the browsers are choosing an element to scroll in, when URL-hash is passed? Or how to prevent the bug and always use body
or html
containers for scrolling?
In my case - the structure is:
html
-> body {display:flex;flex-direction:column}
-> div
-> section {display:flex}
-> ... -> div#my_anchor
And section
had choosed for scroll. I tried to turn off a scrips - no effect, it means scroll does browsers.