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: improve getNestedField to fetch field value in objects containing arrays #581

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dvcanton
Copy link

@dvcanton dvcanton commented Nov 28, 2024

Fixes #580

Changed getNestedField function in FormField component to parse src containing arrays.

  • the regex breaks the path into segments, handling both dot (.) and bracket ([]) notations
  • the filter(Boolean) ensures empty strings are excluded

- the regex breaks the path into segments, handling both dot (.) and bracket ([]) notations
- the filter(Boolean) ensures empty strings are excluded

Signed-off-by: Dave Canton <[email protected]>
@dvcanton dvcanton force-pushed the fix-nested-form-field branch from 6aa2623 to 8bd878c Compare November 29, 2024 00:43
@dvcanton
Copy link
Author

@agilgur5 @keithchong can you review this?

@dvcanton
Copy link
Author

dvcanton commented Dec 3, 2024

\review @andrii-korotkov-verkada

@andrii-korotkov-verkada
Copy link

agilgur5 has stepped down as a maintainer. I'll take a look, but don't have approvers permission.

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.

Function getNestedField in FormFIeld doesn't return correct value for objects containing arrays
2 participants