mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
refactor(EditableTextBase, Button) rename PseudoClass update handlers to be more specific (#7404)
This commit is contained in:
committed by
Manol Donev
parent
4f39fb728b
commit
1a0c81f02a
@@ -92,7 +92,7 @@ export class Button extends ButtonBase {
|
||||
}
|
||||
|
||||
@PseudoClassHandler("normal", "highlighted", "pressed", "active")
|
||||
_updateHandler(subscribe: boolean) {
|
||||
_updateButtonStateChangeHandler(subscribe: boolean) {
|
||||
if (subscribe) {
|
||||
this._highlightedHandler = this._highlightedHandler || ((args: TouchGestureEventData) => {
|
||||
switch (args.action) {
|
||||
|
||||
@@ -42,7 +42,7 @@ export class Button extends ButtonBase {
|
||||
}
|
||||
|
||||
@PseudoClassHandler("normal", "highlighted", "pressed", "active")
|
||||
_updateHandler(subscribe: boolean) {
|
||||
_updateButtonStateChangeHandler(subscribe: boolean) {
|
||||
if (subscribe) {
|
||||
if (!this._stateChangedHandler) {
|
||||
this._stateChangedHandler = new ControlStateChangeListener(this.nativeViewProtected, (s: string) => {
|
||||
|
||||
@@ -23,7 +23,7 @@ export abstract class EditableTextBase extends TextBase implements EditableTextB
|
||||
private _blurHandler = () => this._goToVisualState("blur");
|
||||
|
||||
@PseudoClassHandler("focus", "blur")
|
||||
_updateHandler(subscribe) {
|
||||
_updateTextBaseFocusStateHandler(subscribe) {
|
||||
const method = subscribe ? "on" : "off";
|
||||
|
||||
this[method]("focus", this._focusHandler);
|
||||
|
||||
Reference in New Issue
Block a user