From 85093d635268cf3acb8f59e2ea12f13c758388eb Mon Sep 17 00:00:00 2001 From: Paul Stelzer Date: Tue, 7 May 2019 23:55:42 +0200 Subject: [PATCH] fix(input): clear on edit from inside native input (#17115) fixes #17055 --- core/src/components/input/input.tsx | 9 +++++++++ core/src/components/input/test/basic/index.html | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/core/src/components/input/input.tsx b/core/src/components/input/input.tsx index 7cad1577e5..cd8dc8f8c6 100644 --- a/core/src/components/input/input.tsx +++ b/core/src/components/input/input.tsx @@ -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() { diff --git a/core/src/components/input/test/basic/index.html b/core/src/components/input/test/basic/index.html index d9d57665ae..2b0a8b4dad 100644 --- a/core/src/components/input/test/basic/index.html +++ b/core/src/components/input/test/basic/index.html @@ -118,6 +118,11 @@ + + Clear On Edit + + + Left