Skip to content

Commit

Permalink
fix(input): debounce is set with binding syntax in angular on load (#…
Browse files Browse the repository at this point in the history
…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)
  • Loading branch information
sean-perkins authored Apr 23, 2024
1 parent 3a10821 commit 23321f7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/src/components/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ export class Input implements ComponentInterface {
* such as [type] in Angular.
*/
this.onTypeChange();
this.debounceChanged();
}

componentDidRender() {
Expand Down

0 comments on commit 23321f7

Please sign in to comment.