willmcpo / body-scroll-lock

Body scroll locking that just works with everything 😏
MIT License
4.05k stars 339 forks source link

allow event propagation while preserving functionality #117

Closed cody-unger closed 4 years ago

cody-unger commented 5 years ago

Allows event propagation, still fulfills the purpose stopPropagation was serving

cody-unger commented 5 years ago

See #29. Should also fix the issue raised in #116.

cody-unger commented 5 years ago

Reading through #40 and #41, it seems like the allowTouchMove feature is no longer necessary with the changes in this PR (and the replacement provided in this PR is preferable, because touchmove events will propagate without allowing body scrolling).

diachedelic commented 5 years ago

@cody-unger are you aware that allowTouchMove is required for <textarea> and <input type="range"> elements to function correctly (not just elements which listen for touchmove)?

Edit: not just elements which listen for touchmove on the body

diachedelic commented 5 years ago

I'm happy to test this if that isn't something you've overlooked

cody-unger commented 5 years ago

I hadn't seen that, but I tested and it seems like those elements work fine with my changes.