| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | import { EditableTextBase as EditableTextBaseDefinition, KeyboardType, ReturnKeyType, UpdateTextTrigger, AutocapitalizationType } from "."; | |
| 2 | - import { TextBase, Property, CssProperty, Style, Color, booleanConverter, makeValidator, makeParser } from "../text-base"; | ||
| 2 | + import { TextBase, Property, CssProperty, Style, Color, booleanConverter, makeValidator, makeParser, PseudoClassHandler } from "../text-base"; | ||
| 3 | 3 | ||
| 4 | 4 | export * from "../text-base"; | |
| 5 | 5 | ||
@@ -18,6 +18,17 @@ export abstract class EditableTextBase extends TextBase implements EditableTextB | |||
| 18 | 18 | ||
| 19 | 19 | public abstract dismissSoftInput(); | |
| 20 | 20 | public abstract _setInputType(inputType: number): void; | |
| 21 | + | ||
| 22 | + private _focusHandler = () => this._goToVisualState("focus"); | ||
| 23 | + private _blurHandler = () => this._goToVisualState("blur"); | ||
| 24 | + | ||
| 25 | + @PseudoClassHandler("focus", "blur") | ||
| 26 | + _updateHandler(subscribe) { | ||
| 27 | + const method = subscribe ? "on" : "off"; | ||
| 28 | + | ||
| 29 | + this[method]("focus", this._focusHandler); | ||
| 30 | + this[method]("blur", this._blurHandler); | ||
| 31 | + }; | ||
| 21 | 32 | } | |
| 22 | 33 | ||
| 23 | 34 | // TODO: Why not name it - hintColor property?? | |
| Back | FazBrowse Home | New Git URL |
0 commit comments