You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: ionChange event not triggered on v7 ion-searchbar #27192
Thanks for the report. Did you see the breaking changes guide for ion-searchbar?
ionChange is no longer emitted when the value of ion-searchbar is modified externally. ionChange is only emitted from user committed changes, such as typing in the searchbar and the searchbar losing focus or pressing the "Enter" key.
@liamdebeasi The bit about the searchbar in breaking.md is still confusing. I had to read it a couple of times to get it. At first glance it seems to list the options for which the ionChange is emitted (1. typing in the searchbar, 2. The searchbar losing focus, 3. Pressing the Enter key), even though it is written correctly:
"...ionChange is only emitted from user committed changes, such as typing in the searchbar and the searchbar losing focus or pressing the "Enter" key."
Maybe it could be rewritten to:
"...ionChange is only emitted from user committed changes, (e.g. the searchbar losing focus after typing into it or pressing the "Enter" key after typing into it.)"
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.
Activity
liamdebeasi commentedon Apr 13, 2023
Thanks for the report. Did you see the breaking changes guide for
ion-searchbar?Source: https://github.com/ionic-team/ionic-framework/blob/main/BREAKING.md#searchbar
If you want to detect keystrokes you should use
ionInputinstead.ionChangeonly fires once the searchbar has lost focus.guillaumesmo commentedon Apr 13, 2023
🤦 OK sorry for that I completely missed the second condition in that sentence
That being said, wouldn't it make sense to update the demo on the website to use ionInput instead of ionChange then? As the debounce isn't working there currently
https://ionicframework.com/docs/api/searchbar#debounce
liamdebeasi commentedon Apr 13, 2023
No problem 👍
Yes, looks like that should be updated to use
ionInput. I put up a PR to fix that here: ionic-team/ionic-docs#2913guillaumesmo commentedon Apr 13, 2023
I tried to contibute my 2 cents here but you were much faster 👍
https://github.com/ionic-team/ionic-docs/compare/main...guillaumesmo:ionic-docs:guillaumesmo-patch-1?expand=1
Thanks for the great work here
liamdebeasi commentedon Apr 13, 2023
Thanks! I'll give you co-author credit when the docs PR merges.
liamdebeasi commentedon Apr 13, 2023
I merged the docs fix in ionic-team/ionic-docs@eb79612 and gave you co-author credit. The change should be live on the docs website soon.
I am going to close this, but let me know if you have other questions.
ntorrey commentedon Apr 18, 2023
@liamdebeasi The bit about the searchbar in breaking.md is still confusing. I had to read it a couple of times to get it. At first glance it seems to list the options for which the ionChange is emitted (1. typing in the searchbar, 2. The searchbar losing focus, 3. Pressing the Enter key), even though it is written correctly:
"...ionChange is only emitted from user committed changes, such as typing in the searchbar and the searchbar losing focus or pressing the "Enter" key."
Maybe it could be rewritten to:
"...ionChange is only emitted from user committed changes, (e.g. the searchbar losing focus after typing into it or pressing the "Enter" key after typing into it.)"
If I was confused maybe others could be too.
ionitron-bot commentedon May 18, 2023
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.