fix(ui): mark DropdownMenu/ContextMenu/Menubar portals non-translatable - #5214
Merged
Conversation
#5204 fixed Select crashing when a browser's page-translation feature (Chrome Translate, etc.) mutates text nodes inside a Radix portal, causing React's next unmount/reconcile to throw NotFoundError on removeChild — a known class of bug (radix-ui/primitives#3795, react/react#11538), not specific to Select. DropdownMenu, ContextMenu, and Menubar share the exact same Portal+Content/SubContent shape and short technical-label item content as Select, so they're equally exposed. Applies the same translate="no" + notranslate guard to their Content/SubContent, matching the fix already shipped for Select.
pedrofrxncx
enabled auto-merge (squash)
July 24, 2026 17:48
decocms Bot
pushed a commit
that referenced
this pull request
Jul 24, 2026
PR: #5214 fix(ui): mark DropdownMenu/ContextMenu/Menubar portals non-translatable Bump type: patch - @deco/ui (packages/ui/package.json): 1.5.1 -> 1.5.2 Deploy-Scope: both
pedrofrxncx
added a commit
that referenced
this pull request
Jul 24, 2026
#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.
This was referenced Jul 27, 2026
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.
Follows #5204, which fixed
Selecthard-crashing (NotFoundError: Failed to execute 'removeChild' on 'Node') when a browser's page-translation feature (Chrome Translate, etc.) rewrites text nodes inside a Radix portal — React's next unmount/reconcile then tries to remove a node translation already mutated and throws. That PR's own root-cause writeup cites this as "a known, well-documented class of bug — not specific to how Select is used here" (radix-ui/primitives#3795, #2578; react/react#11538).DropdownMenu,ContextMenu, andMenubar(packages/ui/src/components/{dropdown-menu,context-menu,menubar}.tsx) share the exact samePortal+Content/SubContentshape asSelectContent, and render the same kind of short technical-label list items (not prose) — so they're equally exposed to the same non-deterministic crash whenever a user has browser translation active, and the same trade-off reasoning from #5204 (short technical labels, not machine-translatable prose) applies unchanged. This applies the identicaltranslate="no"attribute +notranslateclass fix already shipped forSelectto theirContent/SubContent, closing the gap left in these three sibling components.Behavior-preserving style-only change (adds an attribute + a Tailwind/DOM
notranslateclass to each portaled content element) — no logic touched, no test existed for the analogousselect.tsxfix either.How to verify: open any
DropdownMenu/ContextMenu/Menubarin the app with Chrome's "Translate this page" turned on and confirm no crash on open/close (mirrors the manual test plan in #5204).Local checks:
bun run fmt(clean) andbunx tsc --noEmitscoped to the touched files show no new errors (pre-existing unrelated errors from a staleapps/web/src/views/virtual-mcpdirectory are untouched by this diff). Full CI validates the rest.Summary by cubic
Prevents crashes in portaled menus when browser translation is enabled by marking
DropdownMenu,ContextMenu, andMenubarportal content as non-translatable. Mirrors theSelectfix in #5204 with no behavior changes.Content/SubContentinDropdownMenu,ContextMenu, andMenubar.Written for commit 9948f9a. Summary will update on new commits.