fix: open the reader's more menu in place instead of sliding in from the right

This commit is contained in:
Linus Rath
2026-10-28 21:04:30 +01:00
parent 14871f784d
commit d9afc9b643
+6 -1
View File
@@ -465,13 +465,18 @@ export const ContextMenu = forwardRef<HTMLDivElement, ContextMenuProps>(
<MenuLevelContext.Provider value={level}>
<div
ref={setRefs}
// w-max: before the first clamp the menu sits where it opened,
// often near the window's right edge, and would shrink to the room
// left there. Clamped by that narrower width, it then grows and
// jumps left (the ⋮ menu slid in).
className={cn(
"fixed z-50 min-w-[200px] outline-none",
"fixed z-50 w-max min-w-[200px] outline-none",
CONTEXT_MENU_PANEL_CLASS
)}
style={{
left: renderPosition.x,
top: renderPosition.y,
maxWidth: `calc(100vw - ${2 * VIEWPORT_MARGIN}px)`,
visibility: isPositioned ? "visible" : "hidden",
}}
role="menu"