-
Notifications
You must be signed in to change notification settings - Fork 13
refactor(vertical-navbar): use native CSS animations for si-navbar-ve… #1350
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
spike-rabbit
left a comment
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.
Did you check whether it might be easier to just use animate.enter / leave instead of always having those elements in the DOM?
projects/element-ng/navbar-vertical/si-navbar-vertical-header.component.scss
Outdated
Show resolved
Hide resolved
projects/element-ng/navbar-vertical/si-navbar-vertical-header.component.scss
Outdated
Show resolved
Hide resolved
a19beeb to
6c3d17c
Compare
|
Documentation. Coverage Reports: |
7b8a735 to
7a6798f
Compare
@spike-rabbit we use now |
projects/element-ng/navbar-vertical/si-navbar-vertical-header.component.scss
Outdated
Show resolved
Hide resolved
| constructor() { | ||
| afterNextRender(() => { | ||
| // Only enable transitions after the first render to avoid unwanted animations on load | ||
| this.initialized.set(true); | ||
| }); | ||
| } |
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.
you can simplify this by adding an enter animation on the host element an then something like this in the style sheets.
:host.component-enter .inline-group {
// Prevents initial animation on component load
transition: none;
}
Then we have less custom JS logic. See the navbar group for an example.
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.
I was trying the same thing but Angular doesn't drop the 'animate.enter' class from the DOM. When I bind it to the host:
host: {
'animate.enter': 'component-enter',
...I assume it is cause by the existing transition on the host element. I guess Angular internally listen to the animationend and gets somehow confused.
734b68c to
2ba567d
Compare
|
As already discussed with @spliffone, I’m closing this in favor of #1226, where the full animations refactoring will be handled. |
…rtical-header