diff --git a/src/components/input/input-base.ts b/src/components/input/input-base.ts index 560dbe0fc8..e11d98b1ac 100644 --- a/src/components/input/input-base.ts +++ b/src/components/input/input-base.ts @@ -147,7 +147,9 @@ export class InputBase extends Ion { * @private */ checkClearOnEdit(inputValue: string) { - if(!this._clearOnEdit) { return; } + if (!this._clearOnEdit) { + return; + } // Did the input value change after it was blurred and edited? if (this._didBlurAfterEdit && this.hasValue()) { @@ -269,7 +271,7 @@ export class InputBase extends Ion { * @private */ onKeydown(val: any) { - if(this._clearOnEdit) { + if (this._clearOnEdit) { this.checkClearOnEdit(val); } } @@ -319,7 +321,7 @@ export class InputBase extends Ion { } // If clearOnEdit is enabled and the input blurred but has a value, set a flag - if(this._clearOnEdit && !inputHasFocus && this.hasValue()) { + if (this._clearOnEdit && !inputHasFocus && this.hasValue()) { this._didBlurAfterEdit = true; } } diff --git a/src/components/input/input.ts b/src/components/input/input.ts index 66c46ae466..e263799e58 100644 --- a/src/components/input/input.ts +++ b/src/components/input/input.ts @@ -221,7 +221,7 @@ export class TextInput extends InputBase { } // By default, password inputs clear after focus when they have content - if(this.type === 'password' && this.clearOnEdit !== false) { + if (this.type === 'password' && this.clearOnEdit !== false) { this.clearOnEdit = true; } } diff --git a/src/components/input/native-input.ts b/src/components/input/native-input.ts index 8b4734cc6f..d34f25e992 100644 --- a/src/components/input/native-input.ts +++ b/src/components/input/native-input.ts @@ -35,10 +35,10 @@ export class NativeInput { _change(ev: any) { this.valueChange.emit(ev.target.value); } - + @HostListener('keydown', ['$event']) _keyDown(ev: any) { - if(ev) { + if (ev) { ev.target && this.keydown.emit(ev.target.value); } }