mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-23 14:01:20 +08:00
style(input): fix lints
This commit is contained in:
@ -147,7 +147,9 @@ export class InputBase extends Ion {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
checkClearOnEdit(inputValue: string) {
|
checkClearOnEdit(inputValue: string) {
|
||||||
if(!this._clearOnEdit) { return; }
|
if (!this._clearOnEdit) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Did the input value change after it was blurred and edited?
|
// Did the input value change after it was blurred and edited?
|
||||||
if (this._didBlurAfterEdit && this.hasValue()) {
|
if (this._didBlurAfterEdit && this.hasValue()) {
|
||||||
@ -269,7 +271,7 @@ export class InputBase extends Ion {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onKeydown(val: any) {
|
onKeydown(val: any) {
|
||||||
if(this._clearOnEdit) {
|
if (this._clearOnEdit) {
|
||||||
this.checkClearOnEdit(val);
|
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 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;
|
this._didBlurAfterEdit = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -221,7 +221,7 @@ export class TextInput extends InputBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// By default, password inputs clear after focus when they have content
|
// 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;
|
this.clearOnEdit = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ export class NativeInput {
|
|||||||
|
|
||||||
@HostListener('keydown', ['$event'])
|
@HostListener('keydown', ['$event'])
|
||||||
_keyDown(ev: any) {
|
_keyDown(ev: any) {
|
||||||
if(ev) {
|
if (ev) {
|
||||||
ev.target && this.keydown.emit(ev.target.value);
|
ev.target && this.keydown.emit(ev.target.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user