Skip to content

Dropdown popover stays visible when element is removed from DOM while open #72

@Manthan08

Description

@Manthan08

When an is removed from the DOM while its popover is open (common in SPA frameworks that mount/unmount components),
disconnectedCallback calls cleanup() which removes scroll/resize listeners but does not hide the popover or reset aria-expanded on
the trigger.

This leaves a stale popover visible on screen with no way to dismiss it.

Steps to reproduce:

  1. Open a dropdown
  2. Remove the element from the DOM (e.g. el.remove())
  3. The popover menu remains visible

Expected: Popover is hidden and ARIA state is reset on removal.

dropdown.js:70-73

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions