twbs / twbs/bootstrap

Dropdown opens and re-closes with one click in Firefox when emulating mobile device

Open
#38,414 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Prerequisites
Describe the issue

When clicking on a dropdown menu in quick succession, clicks after the first seem to trigger both a show and hide event, so the menu ends up in the same state (either shown or hidden) as when I clicked. I've provided a minimal CodePen example below and included a GIF of the behavior exhibiting.

This happens in Firefox when emulating a mobile device. I used Galaxy S20 Android 11. It does not occur when using Firefox at a normal resolution with no mobile emulation enabled. It does not occur in Chrome with or without emulation.

In this GIF, I click a few times slowly to demonstrate the menu opening and closing as expected. I then click somewhat quickly, and the menu frequently opens and re-closes or closes and re-opens in response to a single click.
JTapG4k

Reduced test cases

Minimal reproduction example. A menu with a single dropdown element.
https://codepen.io/ryanwawr/pen/gOBOYWd?editors=1111

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

Windows

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

Firefox

What version of Bootstrap are you using?

5.2.3 in CodePen. Also exhibits in a project I'm developing that uses 5.1.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 linked CodePen reproduction in Firefox using Galaxy S20 mobile emulation, then compare its click behavior with normal Firefox and Chrome. Trace the show and hide events triggered by one click; done means each click changes the dropdown state only once without reopening or re-closing it.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
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.