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

Modal close animation: .modal-dialog and .modal-backdrop duration stack (instead of firing simultaneously) #4036

Closed
mpiasta-ca opened this issue Jul 29, 2015 · 5 comments

Comments

@mpiasta-ca
Copy link

I'm wondering if this is a feature, or unintended behavior...?

When modal is closing, first the .modal-dialog will animate-out; and only when that is complete, then the .modal-backdrop will begin animate-out. So if .modal-dialog animation duration is 300ms, and .modal-backdrop animation is 300ms, it takes 600ms for the modal to close [before the page becomes clickable again].

In contrast, when modal is opening, .modal-dialog and .modal-backdrop animate simultaneously. So if each requires duration of 300ms, the modal only requires 300ms to open.

As someone who does not like waiting, I find this to be irksome. However, if I reduce the animation-out duration to be 150ms for each, for a total of 300ms, the animation feels choppy.

@wesleycho
Copy link
Contributor

Can you reproduce this in a Plunker? It would make it much easier to debug.

@mpiasta-ca
Copy link
Author

Created a plunkr. When you click the button, it takes 3 seconds to load the modal-dialog and modal-backdrop. When you click close, first the modal-dialog takes 3 seconds to close, then the modal-backdrop takes another 3 seconds to close, for a total of 6 seconds.

@wesleycho wesleycho added this to the Backlog milestone Jul 29, 2015
@wesleycho
Copy link
Contributor

Thanks for this clear reproduction - I will take a look at this possibly this weekend.

If I have this right, you would like the animation of the backdrop and the modal to happen simultaneously when the modal first appears? If so, that sounds like a reasonable request.

@wesleycho wesleycho self-assigned this Jul 29, 2015
@mpiasta-ca
Copy link
Author

I would like the close event for .modal-dialog and .modal-backdrop to trigger at the same time, so that if each has a close animation duration of 250ms, both will be hidden/removed after 250ms (instead of the current 500ms).

ie. while .modal-dialog is fading-out (or sliding-up), that the .modal-backdrop is simultaneously fading from opacity 0.5 to 0.0, such that both close/hide animation events end at the same time (instead of the current case, where the close/hide animation for .modal-backdrop only begins after the animation for .modal-dialog has already ended).

wesleycho added a commit to wesleycho/bootstrap that referenced this issue Jul 29, 2015
- Start animation of backdrop at the same time as the window

Closes angular-ui#4036
@wesleycho wesleycho modified the milestones: 0.13.2 (Performance), Backlog Jul 29, 2015
@mpiasta-ca
Copy link
Author

@wesleycho works great, thanks for fixing that so quickly!

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

2 participants