mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-14 10:01:08 +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 {
|
||||
const result = super.focus();
|
||||
|
||||
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;
|
||||
|
Reference in New Issue
Block a user