You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
md-select with ngModel freezes browser if other errors #2950
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/
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 if (!this.options) clause.
/**
* Sets the select's value. Part of the ControlValueAccessor interface
* required to integrate with Angular's core forms API.
*
* @param value New value to be written to the model.
*/
MdSelect.prototype.writeValue = function (value) {
var _this = this;
if (!this.options) {
// In reactive forms, writeValue() will be called synchronously before
// the select's child options have been created. It's necessary to call
// writeValue() again after the options have been created to ensure any
// initial view value is set.
Promise.resolve(null).then(function () { return _this.writeValue(value); });
return;
}
this._setSelectionByValue(value);
};
Activity
emin93 commentedon Feb 6, 2017
Here is the Plunker link without preview, so code inspection is possible without tab freezing: https://plnkr.co/edit/BARX13?p=info
crisbeto commentedon Feb 6, 2017
Great catch. This should be fixed in #2722, but I'll check if I can backport it to master as well.
fix(select): avoid going into infinite loop under certain conditions
[-]md-select with ngModel freezes browser[/-][+]md-select with ngModel freezes browser if other errors[/+]mrlund commentedon Feb 7, 2017
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
if (!this.options)clause.fix(select): avoid going into infinite loop under certain conditions
fix(select): avoid going into infinite loop under certain conditions (#…
angular-automatic-lock-bot commentedon Sep 5, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.