Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Problem with modal after update to UI bootstrap 0.10.0 #2009

Closed
SimoneSabba opened this issue Mar 31, 2014 · 3 comments
Closed

Problem with modal after update to UI bootstrap 0.10.0 #2009

SimoneSabba opened this issue Mar 31, 2014 · 3 comments

Comments

@SimoneSabba
Copy link

Hi,
I've an unit test that check if a modal is getting closed. Running it with UI Bootstrap 0.9.0 it works fine! I've updated UI Bootstrap to 0.10.0 and now this test doesn't run !!!
$modalInstance.close() works, the modal is closed, but the css class is still present in the DOM !!
My test is like this

// open the modal
myModal.open();
$rootScope.$digest();
// modal should be present in the DOM
angular.element.find('.my-modal-class');

// close the modal
myModal.close();
$rootScope.$digest();
// modal should be not present in the DOM
angular.element.find('.my-modal-class');

And the function to open e close the modal are simply

$modalInstance.close();

and

var modalInstance = $modal.open({
            backdrop: 'static',
            keyboard: false,
            templateUrl: 'modal.tmpl.html',
            controller: "modalCtrl",
            resolve: {
            }
        });

What's wrong? I'm sure that modal is closed....but why do I find '.my-modal-class' in the DOM if is closed?

@chrisirhc
Copy link
Contributor

This maybe due to the closing animation. Could you post a Plunker to demonstrate this?
You might need to do a $timeout.flush().

If it's the closing animation, that will be fixed soon with the new modal animator #1772.

@SimoneSabba
Copy link
Author

Yes it was that!
Now with $timeout.flush() it's working !!!
Thanks @chrisirhc !

@chrisirhc
Copy link
Contributor

No problem!

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

No branches or pull requests

2 participants