Skip to content
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

[@mantine/form] validate-field-value: parent path validation #3080

Merged

Conversation

dmgauthier
Copy link
Contributor

@dmgauthier dmgauthier commented Nov 29, 2022

issue addressed #3064

Issue summary

This is the current behavior

// 'parent.path.precise' is in error.
form.isValid() // false
form.isValid('parent.path') // true  
form.isValid('parent.path.precise') // false

This is the wanted behavior

// 'parent.path.precise' is in error.
form.isValid() // false
form.isValid('parent.path') // false  
form.isValid('parent.path.precise') // false

Fix summary

Current
validateFieldValue receives the path used in form.isValid('path.to.check') and verifies if it match an exact key.

Fixed
validateFieldValue parses the path used in form.isValid('path.to.check') with Array.prototype.split and verifies each path indexes for a match with keys in error.

@rtivital rtivital changed the base branch from dev to master December 4, 2022 11:58
@rtivital rtivital merged commit 440b2e0 into mantinedev:master Dec 4, 2022
@rtivital
Copy link
Member

rtivital commented Dec 4, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants