Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate setCustomValidity ValidityState APIs #2017

Open
staabm opened this issue Jun 20, 2017 · 1 comment
Open

Investigate setCustomValidity ValidityState APIs #2017

staabm opened this issue Jun 20, 2017 · 1 comment

Comments

@staabm
Copy link
Member

staabm commented Jun 20, 2017

modern browsers allow to propagate the valid/invalid state of native element via setCustomValidity ValidityState APIs.
In combination with css pseudo-selector :invalid this could shrink the size of our lib and the markup changes after validation to a minimum.

we should check whether we can apply our feature set to this api and drop the redundant functionality

see
https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Constraint_validation_process

https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation#Constraint_API%27s_element.setCustomValidity()

https://developer.mozilla.org/en-US/docs/Web/API/ValidityState

@staabm staabm added this to the 2.0.0 milestone Jun 20, 2017
@jimmywarting
Copy link

jimmywarting commented Mar 7, 2023

👍

In fav. of using the built in constraint validation.
required is one such thing that you for instance don't need translation for...
you can get a localized message with this api for instance:

const i = document.createElement('input')
i.required = true
i.validationMessage

...and support so many more languages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants