fix(ui): strip lastRenderedPath from copied form state so pasted rows re-render - #17716
Open
1yakub wants to merge 2 commits into
Open
fix(ui): strip lastRenderedPath from copied form state so pasted rows re-render#177161yakub wants to merge 2 commits into
1yakub wants to merge 2 commits into
Conversation
1yakub
requested review from
AlessioGr,
JarrodMFlesch and
jacobsfletch
as code owners
August 7, 2026 17:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #17375
When you copy a blocks row and paste it onto the same field path and row index, the block body goes blank until a full page refresh. The data is intact, it's purely a render bug.
@DarioSiroki traced the root cause in the issue and this PR follows his suggested fix, so full credit for the diagnosis goes to him. In short:
reduceFormStateByPathstripscustomComponentsfrom the copied form state because it isn't serializable, but it keepslastRenderedPath. On paste the server checkslastRenderedPath !== pathto decide whether a field needs rendering, and since the pasted entries carry the stale value from the clipboard, a same path paste looks already rendered and never gets its components back. The client falls back toreturn null, so the whole block body disappears.The fix strips
lastRenderedPathat copy time, both at field level and on row entries, right next to the existingcustomComponentsstripping. Pasted content then renders again on the next form state round trip. As Dario notes in the issue, the trade off is that array pastes get one redundant server render even though theircustomComponentssurvive the merge.Added two unit tests in
mergeFormStateFromClipboard.spec.tscovering field level and row level stripping.