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

Broken scrollbar after closing multiple opened modals #309

Open
robertsine opened this issue Feb 11, 2021 · 1 comment
Open

Broken scrollbar after closing multiple opened modals #309

robertsine opened this issue Feb 11, 2021 · 1 comment

Comments

@robertsine
Copy link

I'm submitting a ... (check one with "x")

[X] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

Current behavior

If you open multiple modals and try to close all of them, it won't remove dialog-open class from body. As a result modals disappear but scrollbar stays not visible.

Expected behavior

Invoking closeAll() or close() for all opened modals should remove dialog-open class from body.

Reproduction of the problem

Demo: https://stackblitz.com/edit/angular-ivy-v9oc5n

  1. Click Open Modal 1 button
  2. Click Open Modal 2 button
  3. Click Close Modal 1 and Modal 2 or Close All Modals button
  4. Try scroll

What is the motivation / use case for changing the behavior?

Sometimes modal contains information and action buttons inside. When we click action button inside modal we may want to ask user for extra confirmation. For example offer details modal and delete button inside. User can missclick and press delete button, so we want warn him about his actions. After user confirmation we close all modals but it would break layout.

Please tell us about your environment:

  • Smart Modal version: 7.4.0
  • Angular version: 9.0.5 and 11.0.8
  • Browser: all
  • Language: all
@maximelafarie
Copy link
Owner

Hi @robertsine, thank you very much for the very complete issue. 🙏
I'll put it in the next release.

🖖

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

No branches or pull requests

2 participants