Skip to content

Commit

Permalink
fix(input): ionInput event type
Browse files Browse the repository at this point in the history
Fixes the emitted event type for input and textarea to use InputEvent.
  • Loading branch information
Sean Perkins authored and sean-perkins committed Nov 8, 2021
1 parent da339a8 commit d811907
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions angular/src/directives/proxies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ export declare interface IonInput extends Components.IonInput {}
})
export class IonInput {
/** Emitted when a keyboard input occurred. */
ionInput!: EventEmitter<CustomEvent<KeyboardEvent>>;
ionInput!: EventEmitter<CustomEvent<InputEvent>>;
/** Emitted when the value has changed. */
ionChange!: EventEmitter<CustomEvent<IInputInputChangeEventDetail>>;
/** Emitted when the input loses focus. */
Expand Down Expand Up @@ -1558,7 +1558,7 @@ export class IonTextarea {
/** Emitted when the input value has changed. */
ionChange!: EventEmitter<CustomEvent<ITextareaTextareaChangeEventDetail>>;
/** Emitted when a keyboard input occurred. */
ionInput!: EventEmitter<CustomEvent<KeyboardEvent>>;
ionInput!: EventEmitter<CustomEvent<InputEvent>>;
/** Emitted when the input loses focus. */
ionBlur!: EventEmitter<CustomEvent<FocusEvent>>;
/** Emitted when the input has focus. */
Expand Down
4 changes: 2 additions & 2 deletions core/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ ion-input,method,setFocus,setFocus() => Promise<void>
ion-input,event,ionBlur,FocusEvent,true
ion-input,event,ionChange,InputChangeEventDetail,true
ion-input,event,ionFocus,FocusEvent,true
ion-input,event,ionInput,KeyboardEvent,true
ion-input,event,ionInput,InputEvent,true
ion-input,css-prop,--background
ion-input,css-prop,--color
ion-input,css-prop,--padding-bottom
Expand Down Expand Up @@ -1331,7 +1331,7 @@ ion-textarea,method,setFocus,setFocus() => Promise<void>
ion-textarea,event,ionBlur,FocusEvent,true
ion-textarea,event,ionChange,TextareaChangeEventDetail,true
ion-textarea,event,ionFocus,FocusEvent,true
ion-textarea,event,ionInput,KeyboardEvent,true
ion-textarea,event,ionInput,InputEvent,true
ion-textarea,css-prop,--background
ion-textarea,css-prop,--border-radius
ion-textarea,css-prop,--color
Expand Down
4 changes: 2 additions & 2 deletions core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4791,7 +4791,7 @@ declare namespace LocalJSX {
/**
* Emitted when a keyboard input occurred.
*/
"onIonInput"?: (event: CustomEvent<KeyboardEvent>) => void;
"onIonInput"?: (event: CustomEvent<InputEvent>) => void;
/**
* Emitted when the styles change.
*/
Expand Down Expand Up @@ -6498,7 +6498,7 @@ declare namespace LocalJSX {
/**
* Emitted when a keyboard input occurred.
*/
"onIonInput"?: (event: CustomEvent<KeyboardEvent>) => void;
"onIonInput"?: (event: CustomEvent<InputEvent>) => void;
/**
* Emitted when the styles change.
*/
Expand Down
4 changes: 2 additions & 2 deletions core/src/components/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export class Input implements ComponentInterface {
/**
* Emitted when a keyboard input occurred.
*/
@Event() ionInput!: EventEmitter<KeyboardEvent>;
@Event() ionInput!: EventEmitter<InputEvent>;

/**
* Emitted when the value has changed.
Expand Down Expand Up @@ -314,7 +314,7 @@ export class Input implements ComponentInterface {
if (input) {
this.value = input.value || '';
}
this.ionInput.emit(ev as KeyboardEvent);
this.ionInput.emit(ev as InputEvent);
}

private onBlur = (ev: FocusEvent) => {
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/input/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ export default defineComponent({
| `ionBlur` | Emitted when the input loses focus. | `CustomEvent<FocusEvent>` |
| `ionChange` | Emitted when the value has changed. | `CustomEvent<InputChangeEventDetail>` |
| `ionFocus` | Emitted when the input has focus. | `CustomEvent<FocusEvent>` |
| `ionInput` | Emitted when a keyboard input occurred. | `CustomEvent<KeyboardEvent>` |
| `ionInput` | Emitted when a keyboard input occurred. | `CustomEvent<InputEvent>` |


## Methods
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/textarea/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ export default defineComponent({
| `ionBlur` | Emitted when the input loses focus. | `CustomEvent<FocusEvent>` |
| `ionChange` | Emitted when the input value has changed. | `CustomEvent<TextareaChangeEventDetail>` |
| `ionFocus` | Emitted when the input has focus. | `CustomEvent<FocusEvent>` |
| `ionInput` | Emitted when a keyboard input occurred. | `CustomEvent<KeyboardEvent>` |
| `ionInput` | Emitted when a keyboard input occurred. | `CustomEvent<InputEvent>` |


## Methods
Expand Down
4 changes: 2 additions & 2 deletions core/src/components/textarea/textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export class Textarea implements ComponentInterface {
/**
* Emitted when a keyboard input occurred.
*/
@Event() ionInput!: EventEmitter<KeyboardEvent>;
@Event() ionInput!: EventEmitter<InputEvent>;

/**
* Emitted when the styles change.
Expand Down Expand Up @@ -316,7 +316,7 @@ export class Textarea implements ComponentInterface {
this.value = this.nativeInput.value;
}
this.emitStyle();
this.ionInput.emit(ev as KeyboardEvent);
this.ionInput.emit(ev as InputEvent);
}

private onFocus = (ev: FocusEvent) => {
Expand Down

0 comments on commit d811907

Please sign in to comment.