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

fix(dialog): multiple dialogs not opening with disabled animations #6736

Conversation

devversion
Copy link
Member

@devversion devversion commented Aug 30, 2017

With SHA 36f708c, second dialogs can be only opened if the first dialog finished animating.

Due to the recent update to Angular 4.3, the animation trigger callbacks are firing in a wrong order (done callback fires before start), which causes the _isAnimating property to be set to true while the animation already finished.

@crisbeto Not too happy how the tests ended up.

Fixes #6719

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Aug 30, 2017
@devversion devversion added in progress This issue is currently in progress and removed pr: needs review labels Aug 30, 2017
it('setting selected should update input and close calendar', () => {
expect(document.querySelector('md-dialog-container')).toBeNull();

// The fake async zone expects all active timers to be done at the end of the test.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that this kind of comment is necessary for every tick call.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah totally see what you mean. It's just that it can be confusing if we place a tick(500) after every test.

// Note: as of Angular 4.3, the animations module seems to fire the `start` callback before
// the end if animations are disabled. Make this call async to ensure that it still fires
// at the appropriate time.
Promise.resolve().then(() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a test for this fix? The current tests are using the NoopAnimationsModule and they didn't catch the issue.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into a way to reproduce that issue inside of the TestBed, but it looks like the animation callbacks fire correctly there.

I tried to look into the NoopAnimationPlayer from @angular/animations and I assume its related to some timing issues with zone.js

@devversion devversion force-pushed the fix/dialog-noop-animation-secondary-dialog branch 2 times, most recently from c09683f to 9744725 Compare August 30, 2017 20:38
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@devversion devversion added pr: needs review and removed in progress This issue is currently in progress labels Aug 30, 2017
@crisbeto crisbeto added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Aug 30, 2017
@devversion devversion added the P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful label Sep 15, 2017
@devversion devversion force-pushed the fix/dialog-noop-animation-secondary-dialog branch 2 times, most recently from 01fae7a to 1a49212 Compare September 21, 2017 13:46
@TomDemulierChevret
Copy link

Why hasn't this PR been merged and added to the last version ?
This bug induces blocking issues in any app with complex user interactions involving multiple dialog.

The PR has been merge-ready for a while..
Can you merge it quickly so we can at least get a recent build from https://github.com/angular/material2-builds and not stay behind the last release for another month ?

@jelbourn jelbourn added the presubmit failures This PR has failures in Google's internal presubmit process and cannot be immediately merged label Sep 22, 2017
@jelbourn
Copy link
Member

@mmalerba is working on resolving presubmit failures

@mmalerba
Copy link
Contributor

The only presubmit issue left is a screenshot test that shows a second copy of the same dialog opened on top of itself. Do we know if this PR is still necessary or if it can be fixed by a change in animations?

@devversion devversion force-pushed the fix/dialog-noop-animation-secondary-dialog branch from 1a49212 to d542bb4 Compare September 29, 2017 12:56
With SHA 36f708c, second dialogs can be only opened if the first dialog finished animating.

Due to the recent update to Angular 4.3, the animation trigger callbacks are firing in a wrong order (done callback fires before start), which causes the _isAnimating property to be set to true while the animation already finished.

@crisbeto Not too happy how the tests ended up.

Fixes angular#6719
@devversion devversion force-pushed the fix/dialog-noop-animation-secondary-dialog branch from d542bb4 to b13ceca Compare September 30, 2017 16:15
@TomDemulierChevret
Copy link

@mmalerba I juste tested with angular 4.4.4 and angular-material beta 11 and the issue is still present.
So yes, this PR is still needed.

@owen26
Copy link

owen26 commented Oct 12, 2017

Any progress on this issue? It really is blocking our product dev work for IE/Edge browsers.

@nfoenki
Copy link

nfoenki commented Oct 16, 2017

I'm facing the same issue on Safari (Desktop & Mobile). It's a big issue !
@devversion 's fix is working fine
Can it be merged quickly please ??

@jelbourn jelbourn added P2 The issue is important to a large percentage of users, with a workaround and removed P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful labels Oct 26, 2017
@jelbourn
Copy link
Member

We're going to resolve this issue with #8051 instead

@jelbourn jelbourn removed pr: lgtm action: merge The PR is ready for merge by the caretaker labels Oct 27, 2017
@devversion devversion closed this Oct 27, 2017
@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 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has agreed to Google's Contributor License Agreement P2 The issue is important to a large percentage of users, with a workaround presubmit failures This PR has failures in Google's internal presubmit process and cannot be immediately merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not possible to open second dialog if NoopAnimationsModule is used
8 participants