issue: Remove feature not working properly on useFieldArray #11609
Unanswered
charmingjae
asked this question in
Q&A
Replies: 1 comment 3 replies
-
I have the same problem as you, I racked my brain all night thinking it was some implementation error on my part |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Version Number
codesandbox: 7.51.0 , local: 7.50.1
Codesandbox/Expo snack
Codesandbox Link
Steps to reproduce
Hi, this issue is about the feature to add(append) and delete(remove) data using useFieldArray.
Thank you so much for taking the time to look at this issue. I working very hard to resolve this issue and would appreciate any feedback you can provide.
Material UI (MUI)
to receive data input.Controller
component to control the component without usingregister
.control
used inuseFieldArray
uses the control inuseFormContext
.If look at the codesandbox provided above, we'll see that it has two main parts:
Below is the order in which we can view issues.
When you connect to codesandbox, you'll see the following elements.

Enter a value from 1 to 3 in the topmost Input element and press the Add button on the right to add a row.

A new row is created below in the order you entered the values.
Delete the top row of the new rows (the row with the number 1) to the row with the number 3.

When you try to delete the row with the number 2 entered, you can see that the row is not deleted and is changed to a value of the number '3'.

Expected behaviour
Expected behaviour: Expecting things to function normally when adding and deleting data.
1. With all data added.
2. Delete 1 (index: 0)
3. Delete 2 (index: 0)
4. Delete 3 (index: 0)
But now, the functionality works as follows.
1. With all data added.
2. Delete 1 (index: 0) Okay, work properly.
3. Delete 2 (index: 0) Not work properly.
What browsers are you seeing the problem on?
Chrome
Relevant log output
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions