Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
vursen committed Nov 7, 2024
1 parent a6a051a commit 74755df
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
11 changes: 0 additions & 11 deletions packages/combo-box/src/vaadin-combo-box-light-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,6 @@ export const ComboBoxLightMixin = (superClass) =>
});
}

/**
* Returns true if the current input value satisfies all constraints (if any).
* @return {boolean}
*/
checkValidity() {
if (this.inputElement && this.inputElement.validate) {
return this.inputElement.validate();
}
return super.checkValidity();
}

/**
* @protected
* @override
Expand Down
9 changes: 2 additions & 7 deletions packages/date-picker/src/vaadin-date-picker-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -624,13 +624,8 @@ export const DatePickerMixin = (subclass) =>
!this._selectedDate || dateAllowed(this._selectedDate, this._minDate, this._maxDate, this.isDateDisabled);

let inputValidity = true;
if (this.inputElement) {
if (this.inputElement.checkValidity) {
inputValidity = this.inputElement.checkValidity();
} else if (this.inputElement.validate) {
// Iron-form-elements have the validate API
inputValidity = this.inputElement.validate();
}
if (this.inputElement && this.inputElement.checkValidity) {
inputValidity = this.inputElement.checkValidity();
}

return inputValid && isDateValid && inputValidity;
Expand Down
8 changes: 7 additions & 1 deletion packages/login/src/vaadin-login-form-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ export const LoginFormMixin = (superClass) =>
const userName = this.$.vaadinLoginUsername;
const password = this.$.vaadinLoginPassword;

if (this.disabled || !(userName.validate() && password.validate())) {
// eslint-disable-next-line no-restricted-syntax
userName.validate();
// eslint-disable-next-line no-restricted-syntax
password.validate();

if (this.disabled || userName.invalid || password.invalid) {
return;
}

Expand Down Expand Up @@ -114,6 +119,7 @@ export const LoginFormMixin = (superClass) =>
const { currentTarget: inputActive } = e;
const nextInput =
inputActive.id === 'vaadinLoginUsername' ? this.$.vaadinLoginPassword : this.$.vaadinLoginUsername;
// eslint-disable-next-line no-restricted-syntax
if (inputActive.validate()) {
if (nextInput.checkValidity()) {
this.submit();
Expand Down

0 comments on commit 74755df

Please sign in to comment.