ion-searchbar ionChange not working solution

Problem

ionic 7 업데이트 이후에 ion-searchbar 의 ionChange 이벤트가 fire 되지 않는 현상이 생긴다.
‘Enter’키를 누른 이후에는 이벤트가 발생된다.

After the ionic 7 update, the ionChange event of ion-searchbar does not fire.
An event occurs after pressing the 'Enter' key.

구글을 찾아보니, 에러가 리포팅되어 있었다. 근데 해결방법은?

When I searched Google, an error was reported. But what is the solution?

 

Error Reporting here 


Solution

아주 간단히 해결되었다. ionChange => ionInput 이벤트로 변경해 주면 해결된다.

It was solved very simply. This can be resolved by changing the (ionChange) => (ionInput) event.

Example

<ion-searchbar showCancelButton=”focus” #barcode placeholder=”{{ ‘COMMON.search-cutomer’ | translate }}”
   [debounce]=”500″ (ionInput)=”onKeyupKeyword();” [(ngModel)]=”mKeyword” (keypress)=”isNumberKey($event)”>
</ion-searchbar>

		

Leave a Comment