r/HTML • u/Low-Insurance-3678 • Oct 07 '26
Question prevent background from scrolling when a dialog is open with showModal() on safari
hi guys, iv got a dialog thats getting open with the .showModal() but on mobile(iphone safari) i can still scroll through my page even the modal is open,
how can I stop that ?
heres a record link to the issue since cant upload videos https://streamable.com/tk6sw5
4
Upvotes
1
u/cloudstrifeuk Oct 07 '26
Using bootstrap or the like?
You need to set the static background property IIRC
1
u/testingaurora Oct 08 '26
Use
.show()instead of.showModal()