Skip to content
This repository has been archived by the owner on Nov 10, 2018. It is now read-only.

Restore customError property in the ValidityState() polyfill #46

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

michapietsch
Copy link

Hi,

I was missing the customError property when working with setCustomValidity(). I think we can safely assume that a custom error was set when validationMessage contains a message but all the other checks don't qualify.

Regards, Micha

@cferdinandi
Copy link
Owner

Sorry for being dense, but can you tell me what this PR does? Been a little while since I looked at the code on this. Thanks!

@michapietsch
Copy link
Author

Sure, you're welcome! The Constraint API allows to setCustomValidity() to give a custom error message, e.g. "Username already taken" or you can pass an empty string to remove the custom error. This is nice to Integrate additional requirements but still use the Constraint API. The presence of such a custom error is then represented by a property customError: true inside the validityState object. When using the polyfill before this PR, this behavior was overwritten and therefore removed.

@michapietsch michapietsch reopened this Apr 8, 2018
@michapietsch
Copy link
Author

Sorry, I clicked the wrong button 🙈

@cferdinandi cferdinandi mentioned this pull request Apr 12, 2018
@cferdinandi
Copy link
Owner

Makes sense, thanks! And I do that ALL the time. No worries! I'll get this merged soon.

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

Successfully merging this pull request may close these issues.

None yet

2 participants