twbs / twbs/bootstrap

Popovers: triggers click and focus can't be combined

Open
#39,010 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

js v5
Dominant language
MDX
Stars
175k
Forks
78.6k
Avg merge
7h 19m
Merged PRs (30d)
35

Description

Prerequisites
Describe the issue

The documentation says : "How popover is triggered - click | hover | focus | manual. You may pass multiple triggers; separate them with a space. manual cannot be combined with any other trigger."

But if you set data-bs-trigger="click focus" the click trigger doesn't work, only the focus trigger works.
I mean if you click again the button to close the popover, it doesn't close.

Bootstrap 5.3.0

Reduced test cases

Can take the example: https://getbootstrap.com/docs/5.0/components/popovers/#dismiss-on-next-click
and for the red "Dismissable popover" button, replace data-bs-trigger="focus" to data-bs-trigger="click focus".

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

Chrome

What version of Bootstrap are you using?

5.3.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reduced test case from the dismiss-on-next-click popovers documentation example, changing data-bs-trigger="focus" to "click focus". Reproduce the behavior in Chrome, then trace the popover trigger handling; done means both triggers work and clicking the button again closes the popover.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.