Monday, 6 September 2021

Prevent drag scrolling in Safari on Mac

Take a look at this codepen
There's red square in the corner.
enter image description here
If you click (using mouse or touchpad) this square and drag it down - in Safari on Mac .parent element will scroll down.
Even though .parent has overflow-y: hidden;

enter image description here

No scrolling occurs in all other browsers.
How can I prevent this scrolling on safari? As a rough solution, I can listen to the scroll and override the scrollTop if it's not zero, but perhaps there is a more elegant solution?



from Prevent drag scrolling in Safari on Mac

No comments:

Post a Comment