-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: ionChange event not triggered on v7 ion-searchbar #27192
Comments
Thanks for the report. Did you see the breaking changes guide for
Source: https://github.com/ionic-team/ionic-framework/blob/main/BREAKING.md#searchbar If you want to detect keystrokes you should use |
🤦 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 |
No problem 👍 Yes, looks like that should be updated to use |
I tried to contibute my 2 cents here but you were much faster 👍 Thanks for the great work here |
Thanks! I'll give you co-author credit when the docs PR merges. |
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. |
@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: Maybe it could be rewritten to: If I was confused maybe others could be too. |
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. |
Prerequisites
Ionic Framework Version
v7.x
Current Behavior
When typing in the ion-searchbar input, no ionChange event is triggered
changing the debounce property to undefined, 0 or another value doesn't help
only blurring the field triggers the event
Expected Behavior
from v7 migration guide: "ionChange is only emitted from user committed changes, such as typing in the searchbar"
Steps to Reproduce
Go to https://ionicframework.com/docs/api/searchbar#debounce
Search for "York", wait few seconds: nothing happens
blur the input: works as expected
Code Reproduction URL
https://ionicframework.com/docs/api/searchbar#debounce
Ionic Info
Ionic:
Ionic CLI : 6.20.6 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/react 7.0.2
Capacitor:
Capacitor CLI : 4.6.1
@capacitor/android : 4.7.0
@capacitor/core : 4.7.0
@capacitor/ios : not installed
Utility:
cordova-res : 0.15.4
native-run : 1.7.1
System:
NodeJS : v19.9.0 (/usr/local/Cellar/node/19.9.0/bin/node)
npm : 9.6.3
OS : macOS
Additional Information
No response
The text was updated successfully, but these errors were encountered: