Skip to content

Fix popovers dismiss in Chrome browsers#42352

Merged
mdo merged 2 commits intov6-devfrom
v6-popover-trigger-fix
Apr 22, 2026
Merged

Fix popovers dismiss in Chrome browsers#42352
mdo merged 2 commits intov6-devfrom
v6-popover-trigger-fix

Conversation

@mdo
Copy link
Copy Markdown
Member

@mdo mdo commented Apr 22, 2026

Popovers initialized via data-bs-toggle="popover" wouldn't dismiss when you clicked their trigger a second time in Chromium browsers. Safari was fine.

The data API shouldn't be duplicating trigger handling — _setListeners() already handles click, focus, and hover based on the trigger config. initPopover now just calls Popover.getOrCreateInstance(target) (plus preventDefault() on click to preserve the <a href="#"> behavior).

On a fresh popover the first click still works: the capture-phase document handler creates the instance, which registers the click listener on the element, and the newly-added listener fires in the same dispatch's target phase. No more double-toggle, no more stuck _activeTrigger.focus.

Fixes #42339.

@mdo mdo requested a review from a team as a code owner April 22, 2026 17:54
@mdo mdo added this to v6.0.0 Apr 22, 2026
@github-project-automation github-project-automation Bot moved this to Inbox in v6.0.0 Apr 22, 2026
@mdo mdo merged commit 29cf0ab into v6-dev Apr 22, 2026
12 checks passed
@mdo mdo deleted the v6-popover-trigger-fix branch April 22, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

1 participant