dargmuesli / nuxt-cookie-control

A highly configurable cookie banner for Nuxt.
MIT License
248 stars 46 forks source link

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

Open raphaelbernhart opened 2 months ago

raphaelbernhart commented 2 months 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 months ago

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

raphaelbernhart commented 2 months 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 2 months ago

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