bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Modal Dialog doesn't fade out

Open daniel-dara opened this issue 11 years ago • 96 comments

Under certain circumstances, the modal dialog will simply disappear instead of fading out (even though it successfully fades in).

The example in the documentation is what it should do (fade in and out). https://angular-ui.github.io/bootstrap/#/modal

Ironically, the plunker link it generates shows the modal not properly fading out. I've saved my own to serve as an example here: http://plnkr.co/edit/lmFTpQtfgV6qB4AuFrXj?p=preview [Edit from @chrisirhc to reduce confusion: Please take note that the above Plunker does not include angular-animate. As such, no animations should be seen. This is a new requirement for animations, see README.]

I have the same issue in a separate project of mine where I am handling the modal differently but have the same bug. I can provide the 2nd example if it would help but I imagine the plunker should be enough.

The bug appears to be browser independent as it occurs both when I use Chrome v42.0.2311.135 m and in the developer edition of Firefox (39.0a2).

UPDATE: Note that the plnkr is using the latest version of angular-ui (0.13.0) and the latest supported version of angular (1.3.13). This is not about angular 1.4.

daniel-dara avatar May 06 '15 21:05 daniel-dara

Is this on version 0.13.0?

karianna avatar May 07 '15 14:05 karianna

Yes

daniel-dara avatar May 07 '15 16:05 daniel-dara

+1 I can also confirm this issue.

RevanProdigalKnight avatar May 07 '15 17:05 RevanProdigalKnight

Related: #3620. Check out the discussion there about ngAnimate changes in AngularJS 1.3 causing this behavior.

rvanbaalen avatar May 07 '15 17:05 rvanbaalen

also conforming the same issue with 0.13.0 + angular 1.4

xmlking avatar May 11 '15 22:05 xmlking

Does anyone have a workaround for this bug? I really need to have it fixed by next week.

jondthompson avatar May 13 '15 00:05 jondthompson

+1

CoenWarmer avatar May 13 '15 07:05 CoenWarmer

+1

ntrifunovic avatar May 16 '15 14:05 ntrifunovic

@jondthompson you can set animation to false so it works while fixes.

alo avatar May 16 '15 15:05 alo

Like I said did anyone here confirm everything is working as its supposed to when you include ngAnimate?

rvanbaalen avatar May 16 '15 15:05 rvanbaalen

@rvanbaalen With ngAnimate 1.40 rc.2 the modal close successfully, but the animation effect (fade out / in) won't work.

neaped avatar May 18 '15 03:05 neaped

Please test with versions that we actually support. UI Bootstrap supports Angular 1.3 so you should test with Angular 1.3 and ngAnimate 1.3

rvanbaalen avatar May 18 '15 03:05 rvanbaalen

@rvanbaalen UI Bootstrap with Angular 1.3 and ngAnimate 1.3 working fine :)

neaped avatar May 18 '15 08:05 neaped

Thats what I mean. Everything else will be addressed soon when we implement Angular 1.4 compatibility (when the stable release is out).

rvanbaalen avatar May 18 '15 11:05 rvanbaalen

Hope this can help you, seems to be related to:

domEl.one('$animate:close', function closeFn() {
            $rootScope.$evalAsync(afterAnimating);
});

Seems that $animate:close is not triggered with Angular 1.4

robertcasanova avatar May 18 '15 16:05 robertcasanova

Comments from #3620

There is a known issue with Angular 1.4 and the Modal/Carousel directives. The ngAnimate module had some significant changes documented here that breaks how those directives are chaining animations. The area that needs to be addressed in the modal is here. . As a workaround, I changed that line from:

domEl.one('$animate:close', function closeFn() {
    $rootScope.$evalAsync(afterAnimating);
}

To:

$rootScope.$evalAsync(afterAnimating);

Keep in mind, you lose the closing animation.

RobJacobs avatar May 20 '15 13:05 RobJacobs

Using 0.13.0 with angular 1.4 rc2, the modal dialog doesn't even appear for me. Just the dimmed backdrop. Switched back to 0.12.1 and everything is fine again.

vprasanth avatar May 20 '15 17:05 vprasanth

Yay, I think angular 1.4.0 was released tonight :). When I close a dialog, the dialog disappears but the backdrop is still there.

SlippySken avatar May 27 '15 12:05 SlippySken

@SlippySken I don't see the release on the official website, it is still on RC2. However, you can fix the issue as @RobJacobs mention. I did it in my code, and it is working now

citosid avatar May 27 '15 13:05 citosid

I was looking at https://github.com/angular/angular.js/releases. It seems that the official website isn't updated yet. But the workaround is working :). Thanks :)

SlippySken avatar May 27 '15 13:05 SlippySken