SearchBar - Keyboard not showing on iOS


#1

Hi,

I implemented a SearchBar for both platforms, on Android it shows a keyboard when the SearchBar is focused but on iOS it doesn’t.

Here is my code:

XML:

<SearchBar (tap)="toggle()" #sb row="0" hint="Search" (loaded)="onSearchBarLoaded($event)" (clear)="onClear()"></SearchBar>

Component:

     constructor() {
        this.focused = false;
    }
    toggle() {
        console.log('tapped');
        this.focused = !this.focused;
    }

    onSearchBarLoaded(event) {
        if (event.object.android) {
            setTimeout(() => {
                event.object.dismissSoftInput();
                event.object.android.clearFocus();
            }, 0);
        }
    }

    onClear () {
        console.log('onClear');
    }

#2

Was coming from Emulator settings… :triumph: