darkroomengineering / lenis

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

Popup scrollbar not working while using mouse wheel #304

Closed gerlogu closed 9 months ago

gerlogu commented 9 months ago

When I open a popup (from Elementor in Wordpress) the scrollbar is not working while using the mouse wheel.

This is the code I'm using:

<script src="https://cdn.jsdelivr.net/gh/studio-freight/lenis@0.2.28/bundled/lenis.js"></script>

<script>
const lenis = new Lenis({
  duration: 0.85,
  easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)), // https://www.desmos.com/calculator/brs54l4xou
  direction: 'vertical', // vertical, horizontal
  gestureDirection: 'vertical', // vertical, horizontal, both
  smooth: true,
  mouseMultiplier: 1,
  smoothTouch: false,
  touchMultiplier: 2,
  infinite: false,
})

lenis.on('scroll', ({ scroll, limit, velocity, direction, progress }) => {

})

function raf(time) {
  lenis.raf(time)
  requestAnimationFrame(raf)
}

requestAnimationFrame(raf)
</script>
clementroche commented 9 months ago

https://codepen.io/ClementRoche/pen/PoLdjpw

gerlogu commented 9 months ago

Jums, it didn't solve my issue, the lenis is disabled, but the popup scrollbar still doesn't work :( Is there a way to make lenis just affect base website but not popups?

clementroche commented 9 months ago

data-lenis-prevent

gerlogu commented 9 months ago

Fixed, thanks!!