Skip to content

ContextMenu: migrate trigger to display:contents wrapper (align with Tooltip/HoverCard) #3629

Closed as not planned

Description

@cixzhang

ContextMenu renders its right-click trigger as a real styled box (styles.trigger) that hugs its content. This diverges from the rest of the Layer family: HoverCard and Tooltip use a display: contents trigger wrapper so the trigger is the child element — refs are preserved and no extra box is introduced.

The content box means consumers who need the whole area to be right-clickable have to style the wrapper. #3441 added a triggerXstyle prop as a stopgap for the Table full-cell case, but a better long-term fix is to make ContextMenu's trigger display: contents (or fill its container) like the sibling components, and remove the need for the escape hatch.

Do this alongside #3465 (anchor the menu to the right-click target — scroll-follow + auto-flip), since both change how the trigger and menu anchor/position. Migrating the trigger wrapper and reworking positioning in one pass avoids two churny refactors of the same code.

Activity

  1. added
    enhancement
    component
    on Jul 8, 2026
  2. cixzhang commented on Jul 12, 2026

    @cixzhang
    ContributorAuthor

    Superseded by the positioning work in #3866. That approach keeps the trigger's bounding box (needed for correct positioning across scroll containers), which means triggerXstyle stays supported — so the display: contents migration is a non-goal for now.

    Closing as not planned.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    componentenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions