Skip to content

fix(material-experimental/mdc-chips): chip removal not working if animations are disabled #18314

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

Merged
merged 1 commit into from
Jan 29, 2020

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Jan 28, 2020

MDC waits for a transitionend event to fire before it emits the chip removal event, but if animations are disabled the event won't fire. These changes switch to using a very short transition instead.

Note: setting this to a P2, because it has a high probability of breaking people's tests.

Fixes #18303.

…mations are disabled

MDC waits for a `transitionend` event to fire before it emits the chip removal event, but if animations are disabled the event won't fire. These changes switch to using a very short transition instead.

Fixes angular#18303.
@crisbeto crisbeto added P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release labels Jan 28, 2020
@crisbeto crisbeto requested a review from mmalerba as a code owner January 28, 2020 18:49
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jan 28, 2020
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Jan 28, 2020
@jelbourn jelbourn merged commit bb08fa7 into angular:master Jan 29, 2020
// to finish and emitting the remove event at the end. The problem is that if our animations
// were disabled via the `NoopAnimationsModule`, the element won't have a transition and
// `transitionend` won't fire. We work around the issue by assigning a very short transition.
transition-duration: 1ms;
Copy link
Contributor

Choose a reason for hiding this comment

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

@crisbeto in Chrome at least, you could make this even smaller, e.g. 0.0001ms

Copy link
Member Author

Choose a reason for hiding this comment

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

Anything less than 16ms is less than a frame at 60fps so people problably wouldn't notice it anyway.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I'm not sure if it will make any actual difference, I just want to make sure the delay is as small as possible since animations are supposed to be disabled. It's very possible though that the browser treats 0.0001ms and 1ms as the exact same thing

yifange pushed a commit to yifange/components that referenced this pull request Jan 30, 2020
…mations are disabled (angular#18314)

MDC waits for a `transitionend` event to fire before it emits the chip removal event, but if animations are disabled the event won't fire. These changes switch to using a very short transition instead.

Fixes angular#18303.
@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 Feb 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker 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 target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deleting an mdc chip does not work when animations are disabled
4 participants