mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 23:58:13 +08:00
feat(input): debounce controls the timing to delay the ionInput event (#25969)
This commit is contained in:
4
core/src/components.d.ts
vendored
4
core/src/components.d.ts
vendored
@ -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;
|
||||
/**
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user