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

fix: field paths within hooks #10638

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

Conversation

jacobsfletch
Copy link
Member

Field paths within hooks are not correct. For example, an unnamed tab containing a group field and nested text field should have the path myGroupField.myTextField. This is how it is currently formatted within form state, which is correct. However, within hooks that path is formatted as _index-1.myGroupField.myTextField. The leading index should not exist, as this field is considered top-level since it is located within an unnamed tab. This is evident when creating an API request with invalid data and reading the validation errors in the response. The form in the admin panel, for example, returns this response with incorrect paths. The only reason this was never caught within the admin panel is because we merge those errors with the ones we've saved to form state.

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

Successfully merging this pull request may close these issues.

1 participant