You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A validator using setCustomValidity as below will never cause an invalid event to be dispatched.
exportclassMyValidatorextendsValidator<any>{privatecheckboxControl?: HTMLInputElement;protectedoverridecomputeValidity(state){if(!this.checkboxControl){this.checkboxControl=document.createElement('input');this.checkboxControl.type='checkbox';}this.checkboxControl.setCustomValidity('Get rid of me');console.warn('I should be invalid',this.checkboxControl.validity)return{validity: this.checkboxControl.validity,validationMessage: this.checkboxControl.validationMessage,};}
This is due to the Safari workaround here, causing the customError flag to always be false.
What is affected?
Accessibility, Component
Description
A validator using
setCustomValidity
as below will never cause an invalid event to be dispatched.This is due to the Safari workaround here, causing the
customError
flag to always be false.Otherwise new validators are great
Reproduction
https://lit.dev/playground/#gist=2fecd21c77070203e5472131ffc9b199
Workaround
Force an error on another flag, but this is not really nice:
Is this a regression?
No or unsure. This never worked, or I haven't tried before.
Affected versions
Failing in v1.1.1
Browser/OS/Node environment
Latest chrome on linux
The text was updated successfully, but these errors were encountered: