Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is possible to scroll while a modal is open #321

Closed
danielfliegauf opened this issue Dec 3, 2021 · 5 comments
Closed

It is possible to scroll while a modal is open #321

danielfliegauf opened this issue Dec 3, 2021 · 5 comments
Assignees
Labels

Comments

@danielfliegauf
Copy link

Hello dear DaisyUI Maintainer,

thanks for your awesome work and this fantastique library.
Unfortunately i stumbled over a bug today.

On iOS it is still possible to scroll the background while a modal is open. This results in some nasty flickering since i have a fixed navbar on the bottom (position: fixed; bottom: 0), especially when the safari grows/shrinks the url line on the bottom.

Thank you!
Daniel

@danielfliegauf danielfliegauf changed the title It is possible to scroll on mobile while a modal is open It is possible to scroll while a modal is open Dec 3, 2021
@saadeghi saadeghi self-assigned this Dec 3, 2021
@StefanKandlbinder
Copy link

@danielfliegauf
If you are not dependent on your latest scroll position of the body element, overflow-hidden on the body element should do the trick.
Add it when the modal is opened and remove it, when the modal is closed.
Hope this helps.

Cheers
Stefan

@saadeghi
Copy link
Owner

I was planning to use overscroll-behavior to handle this. Unfortunately Safari does not support that yet.

@StefanKandlbinder
Copy link

StefanKandlbinder commented Dec 19, 2021

It's in development: overscroll behavior.
And you should be able to activate it inside the Experimental Features on IOS.
So, the signs look promising, that it will be shipped by default in the near future...

@saadeghi
Copy link
Owner

I added overscroll-behavior and it's preventing the scrolling of background content. It's currently an experimental feature on Safari but I hope it will be available by default soon.

@saadeghi saadeghi added the modal label Feb 21, 2022
inorganik pushed a commit to inorganik/daisyui that referenced this issue Feb 7, 2023
@nullart
Copy link

nullart commented Mar 29, 2023

This is my hack. Please refer to #1341 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants