dargmuesli / nuxt-cookie-control

A highly configurable cookie banner for Nuxt.
MIT License
231 stars 45 forks source link

feat: disable background scrolling when the modal is open #229

Open raphaelbernhart opened 3 weeks ago

raphaelbernhart commented 3 weeks ago

Describe the feature

At least for me on mac the website is still scrollable even if the modal is opened. IMO it is common sense that the website scroll should be blocked when a modal is opened.

FYI - I'm open to create a MR for this but please add some feedback of your thoughts Sidenote for me: keep iOS in mind when developing this feature.

Additional information

Final checks

dargmuesli commented 2 weeks ago

Good idea, imho. Consider using headlessui/dialog, I'd say :bulb:

raphaelbernhart commented 1 week ago

Good idea, imho. Consider using headlessui/dialog, I'd say 💡

Do you think headlessui could bloat the module unnecessarily? IMO installing a ui-library should be discussed as the module over all could then probably need a refactor?

Nevertheless I think the scroll-disable feature can also be added without installing a third-party (just FYI). What do you think?

raphaelbernhart commented 1 week ago

see https://github.com/dargmuesli/nuxt-cookie-control/discussions/228#discussioncomment-10656009