This repository has been archived by the owner on Jan 18, 2023. It is now read-only.
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.
Feature/password validation #118
Feature/password validation #118
Changes from all commits
41735fc
d3ce216
d644d40
356e09d
333f496
03754f8
a98dd95
aba9c10
b181118
7df22ad
69686e8
184d60b
59600b3
fce204e
2bb25a0
7879807
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
This file was deleted.
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.
should this parameter be called submitCallback rather than submitForm. submitForm makes me think of an html element
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.
i feel like init should be at the top since it's kinda a constructor and that's where i initially looked when i saw 'init'
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.
Fair point. I can move that up.Actually, becauseinit
is not part of theuseForm
function, it can only be moved up to the top of the file. The component is going feel a bit buried, I think. What do you think?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.
this for each confuses me, maybe i need to see it in action
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.
I'm going to rename
schema
toformSchema
just to be clearer. It's matching up elements that have thematches
option. For example:When confPwd fires an onchange event, validation is going to look at its schema and say ok confPwd matches up to pwd and it just plucks pwd's schema from the formSchemas. But when pwd fires an onchange event, its schema does NOT have a
matches
property on it.The loop is going through all the formSchemas checking to see if any singular schema has a
matches
property whose value is pwd, and in this particular case confPwd's schema does contain exactly that.By doing this, we're forcing validation for both elements each time one of them changes.