-
Notifications
You must be signed in to change notification settings - Fork 45
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
Refactor password field validation and restyle #1081
Conversation
🦙 MegaLinter status: ✅ SUCCESS
See errors details in artifact MegaLinter reports on CI Job page |
Codecov Report
@@ Coverage Diff @@
## master #1081 +/- ##
==========================================
+ Coverage 88.69% 88.75% +0.05%
==========================================
Files 102 102
Lines 1778 1778
Branches 412 411 -1
==========================================
+ Hits 1577 1578 +1
+ Misses 201 200 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
fb0447f
to
1f0727f
Compare
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void | ||
error: string | false | ||
value?: string | ||
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void |
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.
It looks like these type changes do not belong to this PR. I don't see any use cases for optional value
and onChange
or TFormValue
here.
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.
The new recommended usage is with name
and validate
, but value
, onChange
, error
still come useful. And keeping them is consistent with grommet's FormField.
I added some tests to validate both uses
464f1bf
to
1a21cf4
Compare
1a21cf4
to
821c8a8
Compare
I tried to make validation part of the input field, so that onSubmit doesn't need to re-check validity of every input field. But then error-specific-styling doesn't work
contentProps={{ border: props.error ? 'bottom' : false }}
.