You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ContextMenu: anchor the menu to the right-click target (scroll-follow + auto-flip) instead of fixed positioning #3465
ContextMenu currently positions its menu at a fixed coordinate captured from the pointer/keyboard invocation point. Because the layer is fixed rather than anchored to the element the menu belongs to:
The menu does not move with its target during scroll — if the underlying content scrolls while the menu is open, the menu stays put and detaches visually from the item it acts on.
There is no auto-flip: when the menu would overflow the viewport near an edge, it can't reposition (flip/shift) the way an anchored layer can.
Proposal
Make the ContextMenu layer contextual (anchored) instead of fixed:
Take the target of the right-click (the element under the invocation point) and apply an anchor to it.
Position the menu relative to that anchor, so the menu tracks the item during scroll and can auto-flip/shift when near viewport edges.
This aligns ContextMenu with the anchored-layer behavior used elsewhere (CSS anchor positioning), giving correct scroll-follow and edge collision handling.
Context
Split out from review discussion on the touch/keyboard invocation work (#3392). That PR intentionally kept the existing fixed positioning; this issue tracks the anchoring follow-up so it can be designed and reviewed on its own.
Part of the accessibility & keyboard-management program (#3343).
Activity
fix(ContextMenu): position the menu relative to context for scroll-fo…
feat(ContextMenu): ContextMenu is built on createContextMenu (spec:AS…
feat(ContextMenu): ContextMenu is built on createContextMenu (spec:AS…
feat(ContextMenu): ContextMenu is built on createContextMenu (spec:AS…