Open joyblanks opened 3 years ago
Same issue here, trying to get it working in React + iOS Safari, but it's leading me to believe that the polyfill just isn't loading at all, since Safari does support scrollIntoView()
without options;
I've looked through #139 and tried all different combinations of importing, putting in a useEffect hook moving it to the top level index.tsx component, etc, and it just won't work if I add options.
Well, I figured out why it wasn't working in my case. For reasons that aren't relevant here, I had this in my css:
html,
body {
height: 100%;
overflow: auto;
width: 100%;
}
Removing overflow: auto
made the scrolling work. Now I have to do some work to be able to remove that style without breaking something else. Ah, web development 🙂
Well, I figured out why it wasn't working in my case. For reasons that aren't relevant here, I had this in my css:
html, body { height: 100%; overflow: auto; width: 100%; }
Removing
overflow: auto
made the scrolling work. Now I have to do some work to be able to remove that style without breaking something else. Ah, web development 🙂
Removing overflow: auto from parent worked for me too. Not sure why it worked🤨
I have an element to center align in page respect to its parent
document.querySelector('#someid').scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'center' });
It works fine without this polyfill (but without behavior smooth of course), But when the polyfill is active the arguments are discarded