feat:Input add getSelection API

This commit is contained in:
pengfei.zhou
2021-06-11 17:40:02 +08:00
committed by osborn
parent 5263731dd7
commit e528630f71
12 changed files with 69 additions and 9 deletions

View File

@@ -27,7 +27,11 @@ export declare class Input extends View {
returnKeyType?: ReturnKeyType;
onSubmitEditing?: (text: string) => void;
getText(context: BridgeContext): Promise<string>;
setSelection(context: BridgeContext, start: number, end?: number): Promise<string>;
setSelection(context: BridgeContext, start: number, end?: number): Promise<any>;
getSelection(context: BridgeContext): Promise<{
start: number;
end: number;
}>;
requestFocus(context: BridgeContext): Promise<any>;
releaseFocus(context: BridgeContext): Promise<any>;
}

View File

@@ -45,6 +45,9 @@ export class Input extends View {
end,
});
}
getSelection(context) {
return this.nativeChannel(context, 'getSelection')();
}
requestFocus(context) {
return this.nativeChannel(context, 'requestFocus')();
}