fix(input): prevent exception when input components outside Content

This commit is contained in:
Josep Sayol
2016-12-14 21:27:19 +01:00
committed by Adam Bradley
parent 4f61ea5f9b
commit e80f4cf88d
5 changed files with 72 additions and 12 deletions

View File

@ -240,8 +240,12 @@ export class TextInput extends InputBase {
*/
ngOnDestroy() {
this._form.deregister(this);
this._scrollStart.unsubscribe();
this._scrollEnd.unsubscribe();
// only stop listening to content scroll events if there is content
if (this._content) {
this._scrollStart.unsubscribe();
this._scrollEnd.unsubscribe();
}
}
/**
@ -410,8 +414,12 @@ export class TextArea extends InputBase {
*/
ngOnDestroy() {
this._form.deregister(this);
this._scrollStart.unsubscribe();
this._scrollEnd.unsubscribe();
// only stop listening to content scroll events if there is content
if (this._content) {
this._scrollStart.unsubscribe();
this._scrollEnd.unsubscribe();
}
}
/**