mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 19:57:22 +08:00
fix(input): prevent input from losing focus when tapping clear button (#18004)
fixes #18002
This commit is contained in:

committed by
Liam DeBeasi

parent
11aa48c83c
commit
29bb4fcb05
@ -307,7 +307,12 @@ export class Input implements ComponentInterface {
|
||||
}
|
||||
}
|
||||
|
||||
private clearTextInput = () => {
|
||||
private clearTextInput = (ev?: Event) => {
|
||||
if (this.clearInput && !this.readonly && !this.disabled && ev) {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
}
|
||||
|
||||
this.value = '';
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user