Skip to content

[Bug]: ContextMenu: pointer-events: auto on trigger elements bypasses global pointer-events: none #1923

Open
@NilsEvers

Description

@NilsEvers

Environment

Developement/Production OS: Windows 10 19043.1110
Node version: 16.0.0
Package manager: [email protected]
Reka UI version: 2.0.0
Vue version: 3.0.0
Nuxt version: 3.0.0
Nuxt mode: universal
Nuxt target: server
CSS framework: [email protected]
Client OS: Windows 10 19043.1110
Browser: Chrome 90.0.4430.212

Link to minimal reproduction

https://stackblitz.com/edit/e4r1j4vf?file=src%2FApp.vue

Steps to reproduce

  1. Go to the reproduction link
  2. Right click on the first ContextMenu trigger zone to open the context menu
  3. Left click on one of the trigger zones

Describe the bug

When a ContextMenu is opened, the <body> element receives pointer-events: none to disable interactions with the rest of the UI. However, each trigger element gets a hardcoded style="pointer-events: auto" applied, which overrides this and allows interactions to still occur on the trigger.

This becomes problematic when the trigger element supports both left-click and right-click actions. For example, in a list of cards:

  • Left-click navigates to another route
  • Right-click opens the context menu

Since the trigger element continues to receive pointer events, users may inadvertently left-click and navigate away, rather than dismissing the context menu as intended.

Expected behavior

Trigger elements should respect the global pointer-events: none when a context menu is open, to prevent unintended interactions.

Context & Screenshots (if applicable)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions