GithubHelp home page GithubHelp logo

Comments (2)

Temzasse avatar Temzasse commented on May 27, 2024

Hi @ScreamZ 👋🏻

The first scrolling issue can probably be solved with a body scroll locking library like this one. Framer Motion should handle body scroll locking automatically for draggable elements but it doesn't work all the time for some reason. So, I guess you can lock the body scroll every time you open the sheet and unlock it when the sheet closes.

I'm not sure if I should include a separate body scroll locking mechanism to this lib since it might not always be desirable to lock the scrolling when the sheet is open (eg. if you open the sheet on desktop etc). I would like to leave these kind of things to the end users. One place where automatic body scroll locking might make sense is the backdrop component since it most likely will alway cover the whole screen and thus you don't want to scroll anything behind it.

from react-modal-sheet.

ScreamZ avatar ScreamZ commented on May 27, 2024

I'm not sure if I should include a separate body scroll locking mechanism to this lib since it might not always be desirable to lock the scrolling when the sheet is open (eg. if you open the sheet on desktop etc). I would like to leave these kind of things to the end users. One place where automatic body scroll locking might make sense is the backdrop component since it most likely will alway cover the whole screen and thus you don't want to scroll anything behind it.

I guess too it doesn't belong to this library, but having a side note somewhere in the documentation giving this example could be nice. I'll use : https://mantine.dev/hooks/use-scroll-lock/ or this one from use-hook https://github.com/streamich/react-use/blob/master/docs/useLockBodyScroll.md

from react-modal-sheet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.