useFieldArray creates a duplicate row when appending after deletion when used with ag-grid #13015
Unanswered
JosephLu2022
asked this question in
Q&A
Replies: 0 comments
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.
-
Hi, I'm using
useFieldArray
with ag-grid and encountering an issue where inserting a row, deleting it, then inserting again results in a duplicated row. Upon inspecting the form state usinggetValues
, the duplicated row appears to contain incomplete or partial data.I'm unsure whether this issue is related to ag-grid itself or my implementation of
useFieldArray
. It seems to occur specifically when usingregister
fromuseFormContext
along with theController
component. But works correctly when i passregister
as a prop.Could someone help clarify why this behavior is happening?
Version Number
7.50.1
Codesandbox
https://codesandbox.io/p/sandbox/friendly-fermi-wp7578
Steps to reproduce
Expected behavior
it should not duplicate on append. should only have 3 rows
What browser are you seeing the problem on?
Chrome
Beta Was this translation helpful? Give feedback.
All reactions