Skip to content

[6.x] Fix CP tab crash when expanding a Bard set after a copy#14951

Draft
o1y wants to merge 3 commits into
statamic:6.xfrom
o1y:fix-13385
Draft

[6.x] Fix CP tab crash when expanding a Bard set after a copy#14951
o1y wants to merge 3 commits into
statamic:6.xfrom
o1y:fix-13385

Conversation

@o1y

@o1y o1y commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Fixes #14946

The chromium render crash ("Aw, Snap") fires when all of these line up in the same click

  1. A rich copy is on the clipboard (text copied from inside a Bard editor).
  2. A hidden Bard editor is revealed (the set's content goes from display:none to visible).
  3. The set's content animates as it appears (the header transition + the fields fading in). This was not there in V5, so this is why this bug was probably not triggering there.

When all three happen inside the one click, Chrome probably trips over its own editing/clipboard code and kills the tab.

In this commit we defer the reveal by one animation frame so the Bard editor is shown just after the click. That moves the work off the click, and the crash can't happen.

@o1y o1y changed the title Fix CP tab crash when expanding a Bard set after a copy [6.x] Fix CP tab crash when expanding a Bard set after a copy Jul 7, 2026
Defer the set reveal by one animation frame so the nested ProseMirror editor doesn't lay out during the trusted-click turn (Chrome ≥148 CFI crash). Covers both reveal paths: expandSet() and expandAll().
@o1y o1y marked this pull request as draft July 7, 2026 15:38
@o1y o1y marked this pull request as ready for review July 7, 2026 16:20
@o1y

o1y commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Whoa. I'm converting this PR to a draft, as I've realized that quite a few fields are affected by this bug and proper testing is needed here. Maybe the team can take it from here. Unfortunately, we're also hitting this crash a few times a day and losing content.. I was hoping it'd be an easy fix 😅

Other reveal-on-click surfaces (collapsible sections, tabs, revealer) share the same pattern and likely need the same guard as well (not verified though)..

@o1y o1y marked this pull request as draft July 7, 2026 16:31
@jasonvarga

Copy link
Copy Markdown
Member

I've thrown my buddy Claude at it. I'll either update this PR or open up a new one.

CleanShot 2026-07-07 at 15 03 23

@o1y

o1y commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Well then let Claude decide! 🥲

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CP crashes the browser when you copy, then expand a Bard-containing Replicator set (Chrome/Edge ≥ 148)

2 participants