Skip to content
Permalink
Browse files

fix(input): clear on edit from inside native input (#17115)

fixes #17055
  • Loading branch information...
paulstelzer authored and brandyscarney committed May 7, 2019
1 parent 9030dcc commit 85093d635268cf3acb8f59e2ea12f13c758388eb
Showing with 14 additions and 0 deletions.
  1. +9 −0 core/src/components/input/input.tsx
  2. +5 −0 core/src/components/input/test/basic/index.html
@@ -314,6 +314,15 @@ export class Input implements ComponentInterface {
}

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() {
@@ -118,6 +118,11 @@
<ion-input clear-input value="reallylonglonglonginputtoseetheedgesreallylonglonglonginputtoseetheedges"></ion-input>
</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-input value="Narrow input"></ion-input>
<ion-label text-right>Left</ion-label>

0 comments on commit 85093d6

Please sign in to comment.
You can’t perform that action at this time.