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

Version 0.13 - modal does not close correctly #3873

Closed
djvs opened this issue Jun 30, 2015 · 15 comments
Closed

Version 0.13 - modal does not close correctly #3873

djvs opened this issue Jun 30, 2015 · 15 comments

Comments

@djvs
Copy link

djvs commented Jun 30, 2015

Backdrop still remains and modal itself is still there, just with opacity of 0. Don't think this is a duplicate of #3633 . Does not occur with 0.12.

@djvs djvs changed the title Version 13 - modal does not close correctly Version 0.13 - modal does not close correctly Jun 30, 2015
@djvs
Copy link
Author

djvs commented Jun 30, 2015

Disabling animation on a modal eliminates the bug...thus guessing it's in here:

5e661d4

No console output...

Side note (although this may be a result of CSS I added via !important) - the whole body flashes black with animation: false.

@wesleycho
Copy link
Contributor

Can you create a reproduction with Plunker?

@iamdey
Copy link

iamdey commented Jun 30, 2015

I got this issue too after migrate to angular 1.4

unfortunatly I can't reproduce on plkr : http://plnkr.co/edit/xofiwx?p=preview
I need to investigate a bit more

@iamdey
Copy link

iamdey commented Jun 30, 2015

sorry I didn't read others issues, I suppose this is more complicated than just an angular upgrade

@iamdey
Copy link

iamdey commented Jun 30, 2015

TL;DR: In order to fix : set animate: false or remove angular-animate from dependencies

Since there is no version specified in this issue, I use angular 1.4.

This is what I found :

I've updated http://plnkr.co/edit/xofiwx?p=preview to make backdrop not removed
it only requires to add angular-animate

in ui-bootstrap we use the event $animate:close which is never fired so the backdrop is never removed from dom : https://github.com/angular-ui/bootstrap/blob/master/src/modal/modal.js#L238

the actual doc for angular.element(selector').one() says it doesn't support namespaces I m not sure if it is related.

Hope this help to fix.

@djvs
Copy link
Author

djvs commented Jun 30, 2015

Yes, thank you esion, wish I caught this 20 minutes ago. Made a sad plunker which doesn't duplicate it, http://plnkr.co/edit/NCmCk722weDma3Mj2b9m?p=preview.

@djvs
Copy link
Author

djvs commented Jun 30, 2015

However removing ng-animate doesn't seem to resolve it for me, while it does on your plunker...

@djvs
Copy link
Author

djvs commented Jun 30, 2015

Ah got it - ngMaterial will also conflict and produce this issue.

@djvs
Copy link
Author

djvs commented Jun 30, 2015

@iamdey
Copy link

iamdey commented Jul 1, 2015

I see ui-router-anim requires ngAnimate.
But no idea for ngMaterial ... any plnkr to reproduce ?

Edit: material requires also ngAnimate

@iamdey
Copy link

iamdey commented Jul 1, 2015

So I think this the same discussion as in #3633 so this one should be closed

@djvs
Copy link
Author

djvs commented Jul 1, 2015

If you look at Daniel's plunker, the behavior is different.

@iamdey
Copy link

iamdey commented Jul 1, 2015

He said it has been resolved by adding ngAnimate
#3633 (comment)

Without it, ui-bootstrap has no idea when remove modal from DOM. So it removes it asap on 1.3. It's just a "bug" in documentation not in code.

In case of angular 1.4, BC breaks have been added arround ngAnimate, so the event used to remove backdrop and modal window from DOM is not triggered anymore see L.238 as I mentionned, this has been discussed here : #3633 (comment)

(Obviously there is lot of mess in the issue :p and two "bugs")

chrisirhc added a commit to chrisirhc/angular-ui-bootstrap that referenced this issue Jul 4, 2015
@chrisirhc
Copy link
Contributor

Should be fixed now via #3895

Above Plunker with fix: http://plnkr.co/edit/R8322USvwVICHy8wjM7Y?p=preview

@chrisirhc chrisirhc self-assigned this Jul 4, 2015
@iamdey
Copy link

iamdey commented Jul 5, 2015

Thank you @chrisirhc, I found some bugs, i'll talk about it in PR

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

No branches or pull requests

4 participants