passing input element reference while validating
This commit is contained in:
parent
1d266f2af3
commit
968e673c59
2
components/dist/input.js
vendored
2
components/dist/input.js
vendored
@ -348,7 +348,7 @@ customElements.define('sm-input',
|
|||||||
const _isValid = this.input.checkValidity();
|
const _isValid = this.input.checkValidity();
|
||||||
let _validity = { isValid: true, errorText: '' }
|
let _validity = { isValid: true, errorText: '' }
|
||||||
if (this.validationFunction) {
|
if (this.validationFunction) {
|
||||||
_validity = this.validationFunction(this.input.value);
|
_validity = this.validationFunction(this.input.value, this);
|
||||||
}
|
}
|
||||||
if (_isValid && _validity.isValid) {
|
if (_isValid && _validity.isValid) {
|
||||||
this.setAttribute('valid', '');
|
this.setAttribute('valid', '');
|
||||||
|
|||||||
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