mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(textarea): ionChange will only emit from user committed changes (#25953)
This commit is contained in:
@@ -344,6 +344,7 @@ export class Input implements ComponentInterface {
|
||||
*/
|
||||
private emitValueChange() {
|
||||
const { value } = this;
|
||||
// Checks for both null and undefined values
|
||||
const newValue = value == null ? value : value.toString();
|
||||
this.ionChange.emit({ value: newValue });
|
||||
}
|
||||
@@ -368,7 +369,7 @@ export class Input implements ComponentInterface {
|
||||
});
|
||||
}
|
||||
|
||||
private onInput = (ev: Event) => {
|
||||
private onInput = (ev: InputEvent | Event) => {
|
||||
const input = ev.target as HTMLInputElement | null;
|
||||
if (input) {
|
||||
this.value = input.value || '';
|
||||
|
||||
Reference in New Issue
Block a user