This repository was archived by the owner on Nov 28, 2023. It is now read-only.
Validation visibility #26
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
JIRA
This adds a prop to
inputProps
that allows a client to pass a function with determines whether or not validation messages should be shown.This seems to offer a good level of flexibility to clients who want to determine when to show visibility, whilst also maintaining
raw
validation state behind the scenes and allowing us to provide reasonable defaults.The library comes with
generic
andonBlur
functions.generic
is used by default and will indicate that validation messages should be shown whenever the field is invalid.An example function:
This could be achieved with top level state, but it seems cleaner to offer this field-level api.
Questions:
inputState
be available to the visibility callback? eg. on.parentState
property or similar.