Merge pull request #2598 from NativeScript/raikov/fix-button-unload

Fixed: There is an exception when removing a button
This commit is contained in:
tzraikov
2016-08-17 16:40:10 +03:00
committed by GitHub

View File

@ -69,6 +69,13 @@ export class Button extends common.Button {
this.style._updateTextTransform();
}
public onUnloaded() {
super.onUnloaded();
if (this._stateChangedHandler) {
this._stateChangedHandler.stop();
}
}
@PseudoClassHandler("normal", "highlighted")
_updateHandler(subscribe: boolean) {
if (subscribe) {