10000 fix(android): display soft input on search bar focus (#10696) · NativeScript/NativeScript@317b098 · GitHub
[go: up one dir, main page]

Skip to content

Commit 317b098

Browse files
authored
fix(android): display soft input on search bar focus (#10696)
1 parent b649c35 commit 317b098

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/core/ui/search-bar/index.android.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,15 @@ export class SearchBar extends SearchBarBase {
121121

122122
public focus(): boolean {
123123
const result = super.focus();
124+
124125
if (result) {
125-
ad.showSoftInput(this.nativeViewProtected);
126+
if (this.nativeViewProtected) {
127+
// Android search view is a view consisted of multiple views, so get the focused view
128+
const focusedNativeView = this.nativeViewProtected.findFocus();
129+
if (focusedNativeView) {
130+
ad.showSoftInput(focusedNativeView);
131+
}
132+
}
126133
}
127134

128135
return result;

0 commit comments

Comments
 (0)
0