Skip to content

pointer-events none is not cleaned up when unmounting dialog that contained opened popover #3445

Open
@adamborowski

Description

@adamborowski

Bug Report: Unresponsive Page After Dialog Unmounting

Description

When using a <Dialog> component that contains an inner <DropdownMenu>, clicking a menu item that triggers the dialog's content unmount causes the entire page to remain unresponsive. It appears that the CSS property pointer-events: none persists even after the dialog is removed.

Steps to Reproduce

  1. Open the dialog.
  2. Open the dropdown menu inside the dialog.
  3. Click the menu item that executes a handler (e.g., handlerThatUnmountsDialog) to unmount the dialog content.
  4. Notice that, although the dialog content is unmounted, the rest of the page remains unclickable due to lingering pointer-events: none.
<Dialog>
  <DialogContent>
    <DropdownMenu>
      <DropdownMenuTrigger />
      <DropdownMenuContent>
        <DropdownMenuItem
          className="text-red-500"
          onClick={handlerThatUnmountsDialog}
        >
          Menu item
        </DropdownMenuItem>
      </DropdownMenuContent>
    </DropdownMenu>
  </DialogContent>
</Dialog>

Expected Behavior

After the dialog content is unmounted, the page should return to its normal state with all pointer events re-enabled, ensuring that the page remains fully interactive.

Actual Behavior

The page remains unclickable after the dialog is unmounted because the pointer-events: none property is not being removed.

Environment

Software Name(s) Version
Radix Packages popover, dialog 1.1.6
React 18, 19
Browser Chrome
Operating System macOS

Additional Context

A minimal reproducible example is available for review here: V0 example.

Suggested Solution

No proposed solution at this time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions