Post

Replies

Boosts

Views

Activity

Reply to Safari JS scroll no longer works with scroll-behavior
Count me as one more person very interested in this! Luckily, the bug is already being tracked here: https://bugs.webkit.org/show_bug.cgi?id=238497 In the mean time, a (very annoying) workaround may look like this: el.style.overflow = 'auto'; window.requestAnimationFrame(() => el.scrollTo({ left: 100, behavior: 'smooth' })); setTimeout(() => (el.style.overflow = 'hidden'), 1000); There are obviously more robust ways to accomplish this (e.g. throttled onScroll watcher to re-apply the hidden style), but this gets the job done at least. Alternatively, if it works with your UI, you can simply apply a pointer-events: none on the scrolling element to prevent the user from interacting with it.
Topic: Safari & Web SubTopic: General Tags:
May ’22