mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(input): ionInput event emits with type of InputEvent (#24111)
The ionInput event for both ion-input and ion-textarea will emit with a type of InputEvent.
This commit is contained in:
@@ -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.
|
||||
@@ -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) => {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user