Skip to content

Commit 6b19bdb

Browse files
committed
fix(android): Display soft input on search bar focus
1 parent b649c35 commit 6b19bdb

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)