detfaellesdesignsystem / dkfds-components

Styling og komponenter
Other
43 stars 13 forks source link

Modal on top of a modal #152

Closed KroloRDS closed 2 years ago

KroloRDS commented 2 years ago

Hello FDS,

I noticed that when I open a modal pop-up on top of another modal the backdrop effect (background dimming black) is applied twice. Then, if I close the top modal the backdrop is gone completely. double_dim no_dim

My proposed solution would be to check before showing/hiding if any other modal is currently shown, like so: document.querySelector(".fds-modal[aria-hidden='false']") !== null And apply/remove backdrop accordingly.

detfaellesdesignsystem commented 2 years ago

Hi @KroloRDS,

Which version are you using? I haven't been able to reproduce this behavior in the lastes release.

That said, we reccomend avoiding having more open modals on the page - it gives a poorer user experience and can result in the user losing the sense of where they are on the page.

Best regards, Kristina Jensen Det Fælles Designsystem