I use scroll in my method
const scrollToCenter = () => {
const kon = document.querySelector('.clazz');
const width = kon.offsetWidth;
kon.scrollTo(width / 2, 0);
};
and it works fine in Chrome and Mozilla. In the Edge I'd got an error "Object doesn't support property or method scrollTo". Is exist any different method to use it in Edge?
The official report : https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/15534521/
The issue has been assigned to someone.
Following the comments the workaround is
"
.scrollTop = 0
instead of .scrollTo(0,0)
In case you want to scroll somewhere else than top i haven’t found a workaround "
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With