-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Conversation
…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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
// 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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
…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.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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.