-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
feat: respect animation @.disabled binding #12829
feat: respect animation @.disabled binding #12829
Conversation
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
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
Note: There are a few more components that use custom transitions but don't respect the |
Nice work. This will be very helpful to me. When you talk about fixing "a few more components" in a later PR, which ones do you mean? For example, |
* Ensures that all components with custom CSS transitions respect the `NoopAnimationsModule` or `[@.disabled]` state. Related to angular#12829
* Ensures that all components with custom CSS transitions respect the `NoopAnimationsModule` or `[@.disabled]` state. Related to angular#12829
Hi @devversion! This PR has merge conflicts due to recent upstream merges. |
3 similar comments
Hi @devversion! This PR has merge conflicts due to recent upstream merges. |
Hi @devversion! This PR has merge conflicts due to recent upstream merges. |
Hi @devversion! This PR has merge conflicts due to recent upstream merges. |
375634d
to
dd3881e
Compare
dd3881e
to
b28d273
Compare
b28d273
to
44473cc
Compare
For custom CSS transitions we currently only check whether the `NoopAnimationsModule` is used or not. If noop animations are used, we apply a CSS class that can be used to set the `transition` or `animation` to `none`. Since developers can toggle the animations dynamically through the `[@.disabled]` binding (which goes down the component tree), we should also respect this binding because such binding is commonly used. Also instead of using a mixin that does magic, we should explicitly manage the selectors in order to keep the generated CSS as predictable and small as possible.
* It can happen that someone applies `[@.disabled]` directly on the component host element (e.g. `<mat-tab-group [@.disabled]="disableAnimations"]></mat-tab-group>`)
44473cc
to
905d620
Compare
@jelbourn This never got merged and now has a lot of conflicts. do you think it's worth rebasing this? I don't think it is a priority, but maybe rather something we need to be aware of when creating the MDC protoypes? |
Yeah we should make sure to do this for the MDC-based components, should be easy since they're still in experimental. If you're going to rebase this one I would suggest splitting it into separate PRs per component |
@mmalerba 👍 Regarding rebasing this PR: I'm not sure it's worth doing that as it probably requires a new audit to look for new instances that need to be updated. |
Yeah, at this point I think we can skip this change and ensure we set things up property for the MDC components. One thought there, though, is that we support more granular animation options instead of it being all or nothing. I've heard from some users that they want to e.g. disable animations for menus, but not for progress-bar/spinner |
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. |
For custom CSS transitions we currently only check whether the
NoopAnimationsModule
is used or not. If noop animations are used, we apply a CSS class that can be used to set thetransition
oranimation
tonone
.Since developers can toggle the animations dynamically through the
[@.disabled]
binding (which goes down the component tree), we should also respect this binding because such binding is commonly used.Also instead of using a mixin that does magic, we should explicitly manage the selectors in order to keep the generated CSS as predictable and small as possible.
See https://angular.io/api/animations/trigger and #12812 (comment)
Note: Technically shouldn't be a breaking change. More a fix for developers using
@.disabled
.