ion-searchbar in ios, when focused, the keyboard will show "return" button but not the "search" button. especially in chinese language.
FInally I found the solution: add form tag to surround ion-searchebar
<form>
<ion-searchbar></ion-searchbar>
</form>
I had to use [ngModelOptions]="{standalone: true}"
<form>
<ion-searchbar [ngModelOptions]="{standalone: true}"></ion-searchbar>
</form>
Otherwise I was getting error
Error: If ngModel is used within a form tag, either the name attribute ...
<form action=".">
<ion-searchbar
[(ngModel)]="searchKey"
[ngModelOptions]="{standalone: true}"
[showCancelButton]="true"
(search)="searchWithKeyword(activeTab)"
(ionCancel)="onCancel($event)"
[placeholder]="somePlaceHolder"
[animated]="false"
[value]=""
name="search"
>
</ion-searchbar>
</form>
I have used form with action="." which is working for for me in IOS
<form action=".">
<ion-searchbar (search)="search()"></ion-searchbar>
</form>
action="." worked for me.
@anjum121 you truly are the king of kings.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Most helpful comment
I have used form with
action="."which is working for for me in IOS