mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00

committed by
Hristo Hristov

parent
b6b5465d32
commit
9437f49aed
@ -4,6 +4,7 @@ import { TextBase, Property, CssProperty, Style, Color, booleanConverter, makeVa
|
|||||||
export * from "../text-base";
|
export * from "../text-base";
|
||||||
|
|
||||||
export abstract class EditableTextBase extends TextBase implements EditableTextBaseDefinition {
|
export abstract class EditableTextBase extends TextBase implements EditableTextBaseDefinition {
|
||||||
|
public static blurEvent = "blur";
|
||||||
|
|
||||||
public keyboardType: KeyboardType;
|
public keyboardType: KeyboardType;
|
||||||
public returnKeyType: ReturnKeyType;
|
public returnKeyType: ReturnKeyType;
|
||||||
|
@ -90,6 +90,8 @@ function initializeEditTextListeners(): void {
|
|||||||
owner.dismissSoftInput();
|
owner.dismissSoftInput();
|
||||||
dismissKeyboardTimeoutId = null;
|
dismissKeyboardTimeoutId = null;
|
||||||
}, 1);
|
}, 1);
|
||||||
|
|
||||||
|
owner.notify({ eventName: EditableTextBase.blurEvent, object: owner });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,6 +8,8 @@ import { TextBase, Property, CssProperty, Style, Color, FormattedString } from "
|
|||||||
* Represents the base class for all editable text views.
|
* Represents the base class for all editable text views.
|
||||||
*/
|
*/
|
||||||
export class EditableTextBase extends TextBase {
|
export class EditableTextBase extends TextBase {
|
||||||
|
public static blurEvent: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets or sets the soft keyboard type.
|
* Gets or sets the soft keyboard type.
|
||||||
*/
|
*/
|
||||||
|
@ -10,6 +10,7 @@ export abstract class EditableTextBase extends EditableTextBaseCommon {
|
|||||||
public nativeView: UITextField | UITextView;
|
public nativeView: UITextField | UITextView;
|
||||||
public dismissSoftInput() {
|
public dismissSoftInput() {
|
||||||
this.nativeView.resignFirstResponder();
|
this.nativeView.resignFirstResponder();
|
||||||
|
this.notify({ eventName: EditableTextBase.blurEvent, object: this });
|
||||||
}
|
}
|
||||||
|
|
||||||
[keyboardTypeProperty.getDefault](): "datetime"| "phone" | "number" | "url" | "email" | string {
|
[keyboardTypeProperty.getDefault](): "datetime"| "phone" | "number" | "url" | "email" | string {
|
||||||
|
Reference in New Issue
Block a user