feat(input, textarea): ionInput and ionChange pass event and value (#26176)

BREAKING CHANGE:

The `detail` payload for the `ionInput` event on `ion-input` and `ion-textarea` now contains an object with the current `value` as well as the native event that triggered `ionInput`.
This commit is contained in:
Liam DeBeasi
2022-11-01 11:30:58 -05:00
committed by GitHub
parent 663750ec17
commit eea6ba996c
10 changed files with 68 additions and 39 deletions

View File

@@ -1,12 +1,16 @@
export interface InputChangeEventDetail {
value: string | undefined | null;
value?: string | number | null;
event?: Event;
}
// We recognize that InputInput is not an ideal naming pattern for this type.
// TODO (FW-2199): Explore renaming this type to something more appropriate.
export type InputInputEventDetail = InputEvent | Event;
export interface InputInputEventDetail {
value?: string | number | null;
event?: Event;
}
export interface InputCustomEvent extends CustomEvent {
detail: InputChangeEventDetail;
export interface InputCustomEvent<T = InputChangeEventDetail> extends CustomEvent {
detail: T;
target: HTMLIonInputElement;
}