Files
payloadcms/test/form-state/collections/Posts/ArrayRowLabel.tsx
Jacob Fletcher b8d7ccb4dc fix(ui): use consistent row ids when duplicating array and block rows (#13679)
Fixes #13653.

Duplicating array rows causes phantom rows to appear. This is because
when duplicate the row locally, we use inconsistent row IDs, e.g. the
`array.rows[0].id` does not match its `array.0.id` counterpart. This
causes form state to lose the reference to the existing row, which the
server interprets as new row as of #13551.

Before:


https://github.com/user-attachments/assets/9f7efc59-ebd9-4fbb-b643-c22d4d3140a3

After:


https://github.com/user-attachments/assets/188db823-4ee5-4757-8b89-751c8d978ad9

---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
  - https://app.asana.com/0/0/1211210023936585
2025-09-03 14:29:39 -04:00

10 lines
212 B
TypeScript

import React from 'react'
export const ArrayRowLabel = (props) => {
return (
<p data-id={props.value[props?.rowNumber - 1]?.id} id="custom-array-row-label">
This is a custom component
</p>
)
}