-
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
md-select with ngModel freezes browser if other errors #2950
Comments
Here is the Plunker link without preview, so code inspection is possible without tab freezing: https://plnkr.co/edit/BARX13?p=info |
Great catch. This should be fixed in #2722, but I'll check if I can backport it to master as well. |
Currently `md-select` calls `writeValue` recursively until the `QueryList` with all of the options is initialized. This usually means 1-2 iterations max, however in certain conditions (e.g. a sibling component throws an error on init) this may not happen and the browser would get thrown into an infinite loop. This change switches to saving the attempted value assignments in a property and applying it after initialization. Fixes angular#2950.
Seems related to #2716 - I think the issue is the infinite loop caused when another error on the page prevents the MdSelect from rendering its options, and thus passing the
|
Currently `md-select` calls `writeValue` recursively until the `QueryList` with all of the options is initialized. This usually means 1-2 iterations max, however in certain conditions (e.g. a sibling component throws an error on init) this may not happen and the browser would get thrown into an infinite loop. This change switches to saving the attempted value assignments in a property and applying it after initialization. Fixes angular#2950.
…2955) * fix(select): avoid going into infinite loop under certain conditions Currently `md-select` calls `writeValue` recursively until the `QueryList` with all of the options is initialized. This usually means 1-2 iterations max, however in certain conditions (e.g. a sibling component throws an error on init) this may not happen and the browser would get thrown into an infinite loop. This change switches to saving the attempted value assignments in a property and applying it after initialization. Fixes #2950. * fix: more elegant approach to initial value and add unit test * fix: button not being removed after test * chore: remove unnecessary expression
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:
Bug
What is the expected behavior?
Normal Angular2 unhandled error in console output
What is the current behavior?
Browser/tab freezes
What are the steps to reproduce?
Simple md-select with an ngModel and another component after the md-select which throws an error.
WARNING: If you open the following plunker template, your browser/tab WILL FREEZE (tested in Chrome and Safari)
Plunker template: https://embed.plnkr.co/BARX13/
The text was updated successfully, but these errors were encountered: