Webflow
5 min

How to Fix FinSweet Disable Scroll Not Working with Lenis in Webflow

Solve the issue where FinSweet’s "disable scrolling" attribute doesn’t work with Lenis smooth scroll in Webflow. Use this lightweight JS fix to pause and resume Lenis scroll when opening and closing modals or menus.

Written by  Asheem ShresthaAsheem ShresthaBlankboard Studio LogoBlankboard Team, Creative Director at Blankboard Studio.
Part of  series.
How to Fix FinSweet Disable Scroll Not Working with Lenis in Webflow
TL;DR Summary

If you're using Lenis smooth scroll in Webflow, you've probably noticed that FinSweet's "disable scrolling" attribute attribute doesn't actually stop scrolling when opening a menu or modal. That’s because Lenis overrides native scroll behavior, so tricks like overflow: hidden won’t stop it.

Here’s a clean, reliable fix: a small JavaScript snippet that listens for clicks on specific elements and tells Lenis to stop or resume scrolling.

How to Fix It

Step 1: Mark Your Triggers in Webflow

  • Add data-disable-scroll to the button that opens your menu or modal.
  • Add data-enable-scroll to the button or element that closes it.
✅ These are custom attributes you can add in Webflow’s Element Settings panel.

Step 2: Add This Script to Your Footer

Paste this after Lenis is initialized:

1<script>
2const LenisClickLock = (() => {
3  let lenisInstance = null;
4
5  function attachLenis() {
6    if (lenisInstance) return true;
7    if (window.lenis) {
8      lenisInstance = window.lenis;
9      return true;
10    }
11    return false;
12  }
13
14  function disableScroll() {
15    if (attachLenis() && lenisInstance.stop) lenisInstance.stop();
16  }
17
18  function enableScroll() {
19    if (attachLenis() && lenisInstance.start) lenisInstance.start();
20  }
21
22  function handleClick(e) {
23    const el = e.target.closest("[data-disable-scroll], [data-enable-scroll]");
24    if (!el) return;
25    el.hasAttribute("data-disable-scroll") ? disableScroll() : enableScroll();
26  }
27
28  function init() {
29    document.addEventListener("click", handleClick, true);
30    window.addEventListener("lenis:ready", attachLenis, { once: true });
31    setTimeout(attachLenis, 0);
32  }
33
34  return { init };
35})();
36
37try {
38  LenisClickLock.init();
39} catch (e) {
40  console.error("[LenisClickLock]", e);
41}
42</script>

Done

This script bridges the gap between FinSweet’s scroll-lock behavior and Lenis’s custom scrolling. It uses lenis.stop() to freeze scroll when needed, and lenis.start() to bring it back — just like native scroll lock, but compatible with Lenis.

No scroll leaks. No flickering. Just smooth interaction.

Share this article
  • https://www.blankboard.studio/originals/blog/fix-finsweet-disable-scroll-lenis
Next in the this series
No items found.