Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Have problems when using a second model inside a model #176

Closed
Rainyhhh opened this issue Sep 18, 2016 · 4 comments
Closed

Have problems when using a second model inside a model #176

Rainyhhh opened this issue Sep 18, 2016 · 4 comments

Comments

@Rainyhhh
Copy link

Here, I am using a model inside another model to implement my functions, which means to popup a model from another model. Actually it works well on the second one, but after closing the model on the top, the original model cannot scroll any more. I don't know why and wonder if any other people have the same problem.

@rbatllet
Copy link

rbatllet commented Oct 8, 2016

You have to add the modal-open class to the body tag because when you close the second modal, it is removed.

    ModalService.showModal({
      templateUrl: 'myTemplate.html',
      controller: 'MyControllerCtrl',
      controllerAs: 'modalCtrl',
      inputs: {
         // my imputs
      }
    }).then(modal => {
      modal.element.modal();
      modal.close.then(() => {
        // ADD HERE AGAIN THE 'modal-open' CLASS TO THE BODY TAG
      });
    });

@smohammedyasin
Copy link

Same problem with me.
for me 'modal-open' class isnot removed from body after close (second) nested modal popup.
<body class="page-container-bg-solid page-header-fixed page-sidebar-closed-hide-logo modal-open page-overflow">

any one found solution for this issue?

@rbatllet
Copy link

rbatllet commented Feb 27, 2017

If you close the nested modal, the "modal-open" class is removed automatically. But then, the first modal cannot scroll any more. To avoid this, we need to add the "modal-open" class in the body again, and then we are able to close the last modal without any trouble.

@dwmkerr
Copy link
Owner

dwmkerr commented May 20, 2017

Thanks for the tips @rbatllet. I'm closing this issue but leaving a reference to it here:

https://github.com/dwmkerr/angular-modal-service#problems-with-nested-modals

@dwmkerr dwmkerr closed this as completed May 20, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants