mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
fix(android): display soft input on search bar focus (#10696)
This commit is contained in:

committed by
GitHub

parent
b649c353fb
commit
317b098321
@ -121,8 +121,15 @@ export class SearchBar extends SearchBarBase {
|
|||||||
|
|
||||||
public focus(): boolean {
|
public focus(): boolean {
|
||||||
const result = super.focus();
|
const result = super.focus();
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
ad.showSoftInput(this.nativeViewProtected);
|
if (this.nativeViewProtected) {
|
||||||
|
// Android search view is a view consisted of multiple views, so get the focused view
|
||||||
|
const focusedNativeView = this.nativeViewProtected.findFocus();
|
||||||
|
if (focusedNativeView) {
|
||||||
|
ad.showSoftInput(focusedNativeView);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
Reference in New Issue
Block a user