Bug fix
This commit is contained in:
parent
df295ae5cd
commit
70b1450438
6
components/dist/input.js
vendored
6
components/dist/input.js
vendored
@ -368,9 +368,13 @@ customElements.define('sm-input',
|
||||
_validity = this.validationFunction(this.input.value);
|
||||
}
|
||||
if (_isValid && _validity.isValid) {
|
||||
this.setAttribute('valid', '');
|
||||
this.removeAttribute('invalid');
|
||||
this.feedbackText.className = 'feedback-text success';
|
||||
this.feedbackText.textContent = '';
|
||||
} else {
|
||||
this.removeAttribute('valid');
|
||||
this.setAttribute('invalid', '');
|
||||
if (this.value.trim() !== '' && (_validity.errorText || this.#validationState.errorText)) {
|
||||
this.showError(_validity.errorText || this.#validationState.errorText);
|
||||
}
|
||||
@ -540,7 +544,7 @@ customElements.define('sm-input',
|
||||
}
|
||||
this.setAttribute('role', 'textbox');
|
||||
if (document.readyState === 'loading') {
|
||||
window.onload = this.applyGlobalCustomValidation
|
||||
window.addEventListener('load', this.applyGlobalCustomValidation, { once: true })
|
||||
} else {
|
||||
this.applyGlobalCustomValidation()
|
||||
}
|
||||
|
||||
2
components/dist/input.min.js
vendored
2
components/dist/input.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user