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(react-form): fallback array field value during index change to prevent uncontrolled error #1378

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MVaik
Copy link

@MVaik MVaik commented Apr 5, 2025

Fixes #1363

More of a draft, while this seems to fix the issue it could have unintended side-effects.
Perhaps it's useful in finding a better solution.

What seems to happen:
Have at least 2 array elements that are not keyed by index.
Remove the first element.
This will cause the second element to be moved up, but it attempts to retrieve a value with the old index, resulting in an undefined value for a short bit.

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.

Non-index keys in React causing inputs to be uncontrolled when removing array fields
1 participant