mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 19:57:22 +08:00
fix(input): clear on edit from inside native input (#17115)
fixes #17055
This commit is contained in:

committed by
Brandy Carney

parent
9030dcc111
commit
85093d6352
@ -314,6 +314,15 @@ export class Input implements ComponentInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.value = '';
|
this.value = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is needed for clearOnEdit
|
||||||
|
* Otherwise the value will not be cleared
|
||||||
|
* if user is inside the input
|
||||||
|
*/
|
||||||
|
if (this.nativeInput) {
|
||||||
|
this.nativeInput.value = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private focusChanged() {
|
private focusChanged() {
|
||||||
|
@ -118,6 +118,11 @@
|
|||||||
<ion-input clear-input value="reallylonglonglonginputtoseetheedgesreallylonglonglonginputtoseetheedges"></ion-input>
|
<ion-input clear-input value="reallylonglonglonginputtoseetheedgesreallylonglonglonginputtoseetheedges"></ion-input>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>Clear On Edit</ion-label>
|
||||||
|
<ion-input clear-on-edit value="reallylonglonglonginputtoseetheedgesreallylonglonglonginputtoseetheedges"></ion-input>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
<ion-item style="max-width: 250px">
|
<ion-item style="max-width: 250px">
|
||||||
<ion-input value="Narrow input"></ion-input>
|
<ion-input value="Narrow input"></ion-input>
|
||||||
<ion-label text-right>Left</ion-label>
|
<ion-label text-right>Left</ion-label>
|
||||||
|
Reference in New Issue
Block a user