Skip to content

fix(ui): mark Popover/HoverCard/Tooltip portals non-translatable - #5218

Merged
pedrofrxncx merged 1 commit into
mainfrom
fix/notranslate-popover-hovercard-tooltip-w1
Jul 24, 2026
Merged

fix(ui): mark Popover/HoverCard/Tooltip portals non-translatable#5218
pedrofrxncx merged 1 commit into
mainfrom
fix/notranslate-popover-hovercard-tooltip-w1

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Follows #5214 (which itself followed #5204's Select fix for the browser page-translation removeChild crash — radix-ui/primitives#3795, react/react#11538). #5214 reasoned that DropdownMenu, ContextMenu, and Menubar "share the exact same Portal+Content/SubContent shape ... as Select, so they're equally exposed" and applied the translate="no" + notranslate guard to them. Popover, HoverCard, and Tooltip share that identical Portal+Content shape but were missed by both fixes, leaving them exposed to the same crash.

Why a maintainer wants this: Tooltip in particular is the most exposed of the three — it mounts/unmounts on every hover in/out, which is exactly the timing race (React reconciling a portal subtree the browser's translation engine just mutated) that throws NotFoundError on removeChild. Popover and HoverCard have the same exposure whenever a Chrome/Chromium-translated page closes one.

This is a markup-only change (one translate="no" prop + one notranslate class per Content, matching #5204/#5214 byte-for-byte) — no logic, no test needed, same as both prior PRs shipped with none.

Command to confirm: cd packages/ui && bunx tsc --noEmit (attribute is a standard passthrough prop on the underlying Radix primitives, already proven safe by the merged #5204/#5214 pattern).

Local checks run: bun run fmt (clean, no changes). bunx tsc --noEmit in packages/ui timed out locally (large package, unrelated to this change) — full CI will validate types.


Summary by cubic

Mark Popover, HoverCard, and Tooltip portal content as non-translatable to prevent Chrome/Chromium page-translation NotFoundError removeChild crashes on mount/unmount. Adds translate="no" and a notranslate class to each Content, matching the prior Select/DropdownMenu/ContextMenu/Menubar fix.

Written for commit 126a61b. Summary will update on new commits.

Review in cubic

#5214 applied the translate="no" + notranslate guard (from #5204's Select fix
for the browser-translation removeChild crash) to DropdownMenu, ContextMenu,
and Menubar, reasoning that they share the exact same Portal+Content shape as
Select. Popover, HoverCard, and Tooltip share that identical shape too but
were left out — same crash surface, same fix.
@pedrofrxncx
pedrofrxncx enabled auto-merge (squash) July 24, 2026 18:20
@pedrofrxncx
pedrofrxncx merged commit 19babc9 into main Jul 24, 2026
14 checks passed
@pedrofrxncx
pedrofrxncx deleted the fix/notranslate-popover-hovercard-tooltip-w1 branch July 24, 2026 18:27
decocms Bot pushed a commit that referenced this pull request Jul 24, 2026
PR: #5218 fix(ui): mark Popover/HoverCard/Tooltip portals non-translatable
Bump type: patch

- @deco/ui (packages/ui/package.json): 1.5.2 -> 1.5.3

Deploy-Scope: both
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.

1 participant