feat(input): debounce controls the timing to delay the ionInput event (#25969)

This commit is contained in:
Sean Perkins
2022-09-20 13:10:50 -04:00
committed by GitHub
parent b4e18494b1
commit 35041b2f3c
3 changed files with 8 additions and 6 deletions

View File

@ -1068,7 +1068,7 @@ export namespace Components {
*/
"color"?: Color;
/**
* Set the amount of time, in milliseconds, to wait to trigger the `ionChange` event after each keystroke. This also impacts form bindings such as `ngModel` or `v-model`.
* Set the amount of time, in milliseconds, to wait to trigger the `ionInput` event after each keystroke.
*/
"debounce": number;
/**
@ -4857,7 +4857,7 @@ declare namespace LocalJSX {
*/
"color"?: Color;
/**
* Set the amount of time, in milliseconds, to wait to trigger the `ionChange` event after each keystroke. This also impacts form bindings such as `ngModel` or `v-model`.
* Set the amount of time, in milliseconds, to wait to trigger the `ionInput` event after each keystroke.
*/
"debounce"?: number;
/**

View File

@ -92,13 +92,13 @@ export class Input implements ComponentInterface {
@Prop() clearOnEdit?: boolean;
/**
* Set the amount of time, in milliseconds, to wait to trigger the `ionChange` event after each keystroke. This also impacts form bindings such as `ngModel` or `v-model`.
* Set the amount of time, in milliseconds, to wait to trigger the `ionInput` event after each keystroke.
*/
@Prop() debounce = 0;
@Watch('debounce')
protected debounceChanged() {
this.ionChange = debounceEvent(this.ionChange, this.debounce);
this.ionInput = debounceEvent(this.ionInput, this.debounce);
}
/**