Skip to content

fix(setValidity): Added support for setting ValidityState from a native input as Chrome #25

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

Merged

Conversation

lideen
Copy link
Contributor

@lideen lideen commented Feb 22, 2021

Another Chrome inconsistency. Chrome allows you to call setValidity with a ValidityState from a native input, this fails in the polyfill.

I found that Object.keys() always returns an empty array when passed a ValidityState object and spread syntax (...) does not work either. Iterating with for...in works though, so I added a step to ensure the input is an object to make sure Object.keys() and ... works as expected.

Copy link
Owner

@calebdwilliams calebdwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@calebdwilliams calebdwilliams merged commit dbb3c1a into calebdwilliams:master Feb 23, 2021
@calebdwilliams
Copy link
Owner

Released in 0.1.9

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

Successfully merging this pull request may close these issues.

2 participants