Menu/Popover: setContent show gate + forms-in-menu auto-close by mdo · Pull Request #42551 · twbs/bootstrap · GitHub
Skip to content

Menu/Popover: setContent show gate + forms-in-menu auto-close#42551

Open
mdo wants to merge 2 commits into
v6-devfrom
mdo/menu-popover-logic-fixes
Open

Menu/Popover: setContent show gate + forms-in-menu auto-close#42551
mdo wants to merge 2 commits into
v6-devfrom
mdo/menu-popover-logic-fixes

Conversation

@mdo

@mdo mdo commented Jun 24, 2026

Copy link
Copy Markdown
Member

Two menu/popover logic fixes, one per commit:

  • Popover/Tooltip: show content set only via setContent()show() gates on _isWithContent(), which read the configured title/content and ignored content supplied through setContent(). A popover whose content was set only via setContent() could never be shown. Count setContent() content in the gate (shared _hasNewContent() helper). Fixes [Popover] Cannot show popover if its title or content was set dynamically #40525.
  • Menu: keep open when clicking inside a form within the menuclearMenus only skipped auto-close for input/select/option/textarea/form tag names, so clicking a form's <label>/button/etc. inside a menu closed it — breaking the documented forms-in-menu example. Skip auto-close for any click inside a form contained in the menu. Fixes Clicks within forms within dropdowns no longer ignored and close the dropdown #41803.

Unit tests added for both (each verified to fail without its fix); full suite passes; lint clean.

🤖 Generated with Claude Code

mdo added 2 commits June 24, 2026 15:01
show() gated on _isWithContent(), which read config title/content and
ignored content supplied through setContent(). A popover whose content
was set only via setContent() could therefore never be shown. Count
setContent() content in the gate via a shared _hasNewContent() helper.
Fixes #40525.
clearMenus only skipped auto-close for input/select/option/textarea/form
tag names, so clicking a form's label/button/etc. inside a menu closed it
— breaking the documented forms-in-menu example. Skip auto-close for any
click inside a form contained in the menu. Fixes #41803.
@mdo mdo requested a review from a team as a code owner June 24, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant