Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Turning backdrop transition off causes backdrop to stick around #1607

Closed
kara opened this issue Oct 25, 2016 · 7 comments · Fixed by #1716
Closed

Turning backdrop transition off causes backdrop to stick around #1607

kara opened this issue Oct 25, 2016 · 7 comments · Fixed by #1716
Assignees
Labels
help wanted The team would appreciate a PR from the community to address this issue P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@kara
Copy link
Contributor

kara commented Oct 25, 2016

If you remove the backdrop transition (e.g. with a backdropClass), the backdrop is never removed because 'transitionend' doesn't fire. This is a problem because then nothing is clickable in the app.

@kara kara added the help wanted The team would appreciate a PR from the community to address this issue label Oct 25, 2016
@jelbourn jelbourn added the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label Oct 25, 2016
@fxck
Copy link
Contributor

fxck commented Oct 26, 2016

There's no easy and performant way to check if element will have transition.

How about something like this, which should support all kinds of transitions:

    if (backdropToDetach) {
      let _hasTransition: boolean = false;

      backdropToDetach.addEventListener('transitionstart', () => _hasTransition = true);

      backdropToDetach.classList.remove('md-overlay-backdrop-showing');
      backdropToDetach.classList.remove(this._state.backdropClass);

      backdropToDetach.addEventListener('transitionend', () => _cleanUpBackdrop());

      setTimeout(() => { if (!_hasTransition) _cleanUpBackdrop() });

    }

That timeout might not even be needed, haven't tried it out.

Also there's typo in that function name _detatchBackdrop should be _detachBackdrop.

@kara @jelbourn ?

@jelbourn
Copy link
Member

jelbourn commented Oct 26, 2016

I was just thinking that we always remove it after X milliseconds if there's no transitionend.
(where X probably equals the animation duration)

@fxck
Copy link
Contributor

fxck commented Oct 26, 2016

Yes, but you'd need to know what's the duration, which you'd have to parse from different css properties(and I think that some animations are inherited, so you'd potentially have to check all parent nodes as well?).

My way should be pretty safe.

@jelbourn
Copy link
Member

For simplicity I'm okay with always removing it after 500ms now- if it ends up being a problem for someone, we can make it configurable.

@fxck
Copy link
Contributor

fxck commented Oct 26, 2016

It looks like transitionstart is not properly implemented anyway, so yeah.

@crisbeto crisbeto added the has pr label Nov 3, 2016
crisbeto added a commit to crisbeto/material2 that referenced this issue Nov 3, 2016
Fixes the dialog's backdrop not being removed if it's transition have been disabled.

Fixes angular#1607.
crisbeto added a commit to crisbeto/material2 that referenced this issue Nov 9, 2016
Fixes the dialog's backdrop not being removed if it's transition have been disabled.

Fixes angular#1607.
crisbeto added a commit to crisbeto/material2 that referenced this issue Nov 10, 2016
Fixes the dialog's backdrop not being removed if it's transition have been disabled.

Fixes angular#1607.
crisbeto added a commit to crisbeto/material2 that referenced this issue Nov 10, 2016
Fixes the dialog's backdrop not being removed if it's transition have been disabled.

Fixes angular#1607.
jelbourn pushed a commit that referenced this issue Nov 11, 2016
#1716)

* fix(dialog): backdrop not being removed if it doesn't have transitions

Fixes the dialog's backdrop not being removed if it's transition have been disabled.

Fixes #1607.
devversion added a commit to devversion/material2 that referenced this issue Dec 30, 2016
* Removes the unnecessary `sleep` in the menu e2e test. The sleep became unecessary because angular#1607 has been fixed.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted The team would appreciate a PR from the community to address this issue P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants