Skip to content

input.setCustomValidity() on custom validation failure? #108

@jwalton

Description

@jwalton

Hey, just wondering if you've though about calling input.setCustomValidition(error) to set a custom validation message (around about here)? Is there some reason you're not doing this? Does this have some hidden pitfalls I'm not aware of?

You'd probably want to only do this if a "customValidation" flag was set or something, because if people are using non-strings as errors or string that need to be translated or something, it would be nice for there to be a way to turn it off... Or, maybe have a getCustomValidationMessage() function which returns a string or undefined so people can translate or do whatever on their own?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprove existing functionality

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions