-
Notifications
You must be signed in to change notification settings - Fork 64
Simplify Input Validation #679
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
Conversation
- remove validate property - add `valid?: boolean` property - call `onValidate` and pass message and valid from meta - onValidate is now a place where the `valid` property can be set/changed and `invalidate` called
valid can now be `boolean | { valid?: boolean; message?: string; }` helperText will show a message if the message value exists. Otherwise, it'll show the set helperText.
Codecov Report
@@ Coverage Diff @@
## master #679 +/- ##
==========================================
- Coverage 99.03% 99.03% -0.01%
==========================================
Files 44 44
Lines 3319 3317 -2
Branches 913 912 -1
==========================================
- Hits 3287 3285 -2
Misses 32 32
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #679 +/- ##
========================================
- Coverage 99.03% 99% -0.03%
========================================
Files 44 44
Lines 3319 3328 +9
Branches 913 918 +5
========================================
+ Hits 3287 3295 +8
- Misses 32 33 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok to me, without having checked it all out. Does it work as expected @nicknisi ?
- add customValidator optional property that can be used to trigger custom vaidation checks AFTER native validation succeeds - prevent onValidate from being called when the validation state hasn't changed
Type: feature
The following has been addressed in the PR:
Description:
Simplify text-input validation
validate
propertyvalid?: boolean | { valid?: boolean; message?: string; }
propertyonValidate
and pass message and valid from metavalid
property.