darkroomengineering / lenis

How smooth scroll should be
https://lenis.darkroom.engineering
MIT License
7.37k stars 317 forks source link

Scroll in desktop Safari and Firefox is broken #223

Closed kasparsz closed 10 months ago

kasparsz commented 10 months ago

Describe the bug In desktop Safari and Firefox error is thrown when scrolling using mouse wheel, because of this smooth scroll doesn't work. Error message in console ReferenceError: Can't find variable: TouchEvent

"TouchEvent" exists in Safari only in mobile browsers "TouchEvent" doesn't exist in desktop Firefox and on mobile (Android) website can't be scrolled, according to https://caniuse.com/?search=TouchEvent it should exist, but it doesn't

Regression was caused by https://github.com/studio-freight/lenis/commit/7740d31ea993bff6b9223dfdcf43b103518d97ec#diff-26d2d26b022d59ed8c5550e926aba16dc0b65e708331db97cc04f0bf36c15111R443-R444

To Reproduce In desktop Safari or desktop Firefox or mobile Firefox (Android) open https://lenis.studiofreight.com/

clementroche commented 10 months ago

fixed in v1.0.22