mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 21:48:42 +08:00
fix(input): prevent exception when input components outside Content
This commit is contained in:

committed by
Adam Bradley

parent
4f61ea5f9b
commit
e80f4cf88d
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user