mui / mui/material-ui

false positive for onDoubleClick on Chip

Open
#29,457 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

scope: chip type: bug
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

If I quickly tap with Chrome for Android on 2 different Chip components so that my taps are very spatially close, the onDoubleClick is called on the second Chip.
This happens if they are close horizontally but also vertically.

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

onDoubleClick is executed even if the Chip where this prop is set was clicked just once

Expected Behavior 🤔

only onClick should be executed

Steps to Reproduce 🕹

https://codesandbox.io/s/fast-waterfall-jkbxy?file=/src/Demo.tsx

Steps:

  1. be sure to be on your mobile (i reproduce it with Chrome on Android)
  2. tap on chip1
  3. quickly tap on chip2

you should see: single1 - single2
what you get is: single1 - single2 - double2

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 CodeSandbox Demo.tsx and reproduce the interaction on Chrome for Android by tapping chip1 and then chip2 quickly. Trace the Chip event handling around onClick and onDoubleClick; done means the sequence produces only single1 - single2, with no double2 callback.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.