Skip to content

Conversation

@Robot-Inventor
Copy link
Contributor

What?

Adding rows to an array field inside repeated Lexical blocks sometimes scrolls to the first block instead of the block where the row was added.

Why?

Row elements share the same DOM id because the parent path isn’t made unique per block in Lexical, so scrollToID matches the first occurrence.

How?

Add a block-unique prefix into the array field path/id generation when rendering array fields, ensuring each block’s rows have distinct DOM ids and scroll targets.

Fixes: #14333

…ay blocks

\## What?

Adding rows to an array field inside repeated Lexical blocks sometimes scrolls to the first block instead of the block where the row was added.

\## Why?

Row elements share the same DOM id because the parent path isn’t made unique per block in Lexical, so `scrollToID` matches the first occurrence.

\## How?

Add a block-unique prefix into the array field path/id generation when rendering array fields, ensuring each block’s rows have distinct DOM ids and scroll targets.

Fixes: payloadcms#14333
@Robot-Inventor Robot-Inventor marked this pull request as ready for review December 28, 2025 12:52
@Robot-Inventor Robot-Inventor marked this pull request as draft December 28, 2025 13:02
@Robot-Inventor
Copy link
Contributor Author

ci / e2e-lexical__collections__Lexical__e2e__blocks is showing the same error on the main branch as well, so it doesn’t seem like its failure is related to the changes in this pull request. Also, if my understanding is correct, it looks like ci / e2e-a11y being stopped is not related to this pull request either.

@Robot-Inventor Robot-Inventor marked this pull request as ready for review December 28, 2025 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant