-
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: ion-input debounce is not set with binding syntax on initial load #29374
bug: ion-input debounce is not set with binding syntax on initial load #29374
Comments
Hello @muuvmuuv thanks for this issue. This is due to a limitation in how/when angular assigns attributes and when our web components are able to detect the change. Currently the value is bound after the As a workaround you can either not use binding syntax for <ion-input
debounce="1200"
(ionInput)="onInput()"
type="search"
></ion-input> or you can update the debounce variable after the component has rendered, such as the I will log this a a bug, as we have implementation adjustments we can make internally to the component to better handle this scenario. |
Good point, that works. I don't need to change the value, so this works for my case but I agree, some console warning would be great. |
Can you test with this dev-build and let me know if you experience any unwanted behaviors?
Forked reproduction with dev-build: https://stackblitz.com/edit/stackblitz-starters-wcwcty?file=package.json |
The dev-build works in our project, even with |
…29377) Issue number: resolves #29374 --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> When using Angular binding syntax, the `debounce` value can be set after `connectedCallback`, but before `componentDidLoad`. This results in the internal representation of the `debounce` value to be the default and the watch callback to never fire. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - The callback handler for `debounce` is called on component load, identical to what we do for the same exact reasons for the input `type`. - `debounce` will correctly reflect and apply the developers value when using binding syntax on initial load ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer for more information. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> Dev-build: `8.0.1-dev.11713879639.102f51a0` Forked reproduction with the dev-build is available here: #29374 (comment)
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
v8.x
Current Behavior
Setting debounce value on ion-input to debounce ionInput event has no effect, it triggers immediately.
Expected Behavior
Debounce
Steps to Reproduce
Code Reproduction URL
https://stackblitz.com/edit/stackblitz-starters-reckxn?file=src%2Fmain.ts
Ionic Info
See repl
Additional Information
No response
The text was updated successfully, but these errors were encountered: