-
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
Infinite loop when toggle sidenav during animation #8869
Comments
…-animation As of angular@004e0fe the drawer supports a two-way binding on the `opened` property, however because the `openedChange` emits at the end of the animation and two-way bindings invoke their setter which then trigger an animation which in turn invokes `openedChange`, there is the potential for an infinite loop if the user changes the `opened` state mid-animation. These changes avoid the issue by turning the `openedChanged` into an async stream and emitting the current value at the end of the animation, rather than determining the value based on the animation state. Fixes angular#8869.
Thanks for the report @iget-master, there's a pending fix, but until it gets in you can work around it by changing the two-way binding on |
…-animation As of angular@004e0fe the drawer supports a two-way binding on the `opened` property, however because the `openedChange` emits at the end of the animation and two-way bindings invoke their setter which then trigger an animation which in turn invokes `openedChange`, there is the potential for an infinite loop if the user changes the `opened` state mid-animation. These changes avoid the issue by turning the `openedChanged` into an async stream and emitting the current value at the end of the animation, rather than determining the value based on the animation state. Fixes angular#8869.
…-animation As of angular@004e0fe the drawer supports a two-way binding on the `opened` property, however because the `openedChange` emits at the end of the animation and two-way bindings invoke their setter which then trigger an animation which in turn invokes `openedChange`, there is the potential for an infinite loop if the user changes the `opened` state mid-animation. These changes avoid the issue by turning the `openedChanged` into an async stream and emitting the current value at the end of the animation, rather than determining the value based on the animation state. Fixes angular#8869.
…-animation (#8872) As of 004e0fe the drawer supports a two-way binding on the `opened` property, however because the `openedChange` emits at the end of the animation and two-way bindings invoke their setter which then trigger an animation which in turn invokes `openedChange`, there is the potential for an infinite loop if the user changes the `opened` state mid-animation. These changes avoid the issue by turning the `openedChanged` into an async stream and emitting the current value at the end of the animation, rather than determining the value based on the animation state. Fixes #8869.
…-animation (#8872) As of 004e0fe the drawer supports a two-way binding on the `opened` property, however because the `openedChange` emits at the end of the animation and two-way bindings invoke their setter which then trigger an animation which in turn invokes `openedChange`, there is the potential for an infinite loop if the user changes the `opened` state mid-animation. These changes avoid the issue by turning the `openedChanged` into an async stream and emitting the current value at the end of the animation, rather than determining the value based on the animation state. Fixes #8869.
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. |
Bug, feature request, or proposal:
Toggling the sidenav menu during animation causes a infinite loop that crashes the browser.
What is the expected behavior?
It's expected that the toggle never crash the browser.
What is the current behavior?
Toggling sidenav too fast (or during the animation) will cause an infinite loop.
What are the steps to reproduce?
It's easy to reproduce, you can use the example given by Material Docs:
https://stackblitz.com/angular/yjjyldrpyyej
Just click it fast, and you will notice that the browser crashes, and throw infinite error messages on console:
Removing the two way binding for sidenav (
[(opened)]="menuOpen"
) workaround the issue, but isn't the fix.Which versions of Angular, Material, OS, TypeScript, browsers are affected?
The latest versions available for everything, I've just installed following documentation.
The browser version is "Versão 62.0.3202.62 (Versão oficial) beta 64 bits"
The text was updated successfully, but these errors were encountered: