JedWatson / JedWatson/react-select

Bug with event.stopPropagation() on container completely breaking functionality

Open
#4,158 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

issue/bug-unconfirmed issue/reviewed
Dominant language
TypeScript
Stars
28k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

event.stopPropagation() that was triggered in 'mousedown' listener on container (it can be any container, document.body, for example) break selector (expand, select, etc) if listener function was added after render Select

To reproduce the error, run document.body.addEventListener('mousedown', (event) => { event.stopPropagation() }); in console and click on selector

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

Reproduce the problem with the document.body mousedown listener shown in the issue, then trace the Select component's event handling around expansion and selection. Confirm the expected behavior by comparing clicks with and without the listener, and ensure the selector remains usable when propagation is stopped.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.