bug(animations): Element rendered twice when animated
See original GitHub issueI’m submitting a…
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:
Current behavior
Expected behavior
Minimal reproduction of the problem with instructions
When triggering an animation of an element shown with *ngIf
while an animation is already running, the element is rendered twice:
The pink and the blue box should only be shown once. This happens when hitting the toggle button multiple times in the following example: angular 7.0.0-beta.7
This also occurs with angular 6.1.9: angular 6.1.9
This issue seems related to https://github.com/angular/angular/issues/23302
Note: at no time there exists more than one component instance, see this example: https://stackblitz.com/edit/angular-gitter-dp3cub
What is the motivation / use case for changing the behavior?
It’s a bug
Environment
Angular version: 7.0.0-beta.7
Browser:
- [x] Chrome (desktop) version 68
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [x] Firefox version 62
- [x] Safari (desktop) version 12
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Modal component renders Twice on open - Stack Overflow
I checked and it is rendered twice because of animation in a Modal component when an animation is finished, modal is rendered second...
Read more >Fixing After Effects and Media Encoder Rendering Bugs and ...
This is a video on avoiding the bugs when rendering with Adobe After Effects and Adobe Media Encoder. Adobe Media encoder has a...
Read more >Solving the React 18 Double Render problem on useEffect
First render animations and many packages have broke being unprepared for this change. useEffect with the empty dependency array is doubl ...
Read more >React Components rendered twice — any way to fix this?
Many developer have implemented a similar functional component and have seen this behavior. Some have even opened a bug report in the official...
Read more >Safari Technology Preview Release Notes - Apple Developer
Web Animations. Added support for passing an optional timeline to Element.animate() (r290655); Changed setting the composite property on a ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t know what
severity1: confusing
means? Perhaps that means hard to duplicate.Here’s how :
I modified the tabs lazy loading demo on stackblitz.
The only thing I changed was adding a
div
element like this to each tab template.You must have a device with a touch screen - or use a phone. You likely won’t be able to click fast enough with a mouse or trackpad.
Then touch as fast as you can :
You’ll see this for tab 2. Notably only the middle tab is affected, so that should aid in troubleshooting.
The user experience will vary depending upon your tabs content. If you have an absolutely positioned tab you may not notice, but with a flex layout it’s a disaster. Also I get this bug on my iPhone with my app during normal usage - so you don’t have to go completely nuts with clicking!
@matsko would love to see progress on this now I found an easy repro.
Having the same issue even when using [@.disabled]. The only solution is remove the animation.
Could this be related to my other issue #35825.
Animations in angular is realy a hot mess because of these bugs. It’s like the developers don’t even care about it.