themesberg / themesberg/flowbite-react

Dropdown.Item - MouseEvent<HTMLElement> is not passed through onclick

Open
#1,402 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.1k
Forks
506
PR merge metrics
No merged PRs in 30d

Description

Because the MouseEvent is not passed through dropdown items, scenarios such as stopping propagation when the dropdown is descendant of another clickable item cannot be supported.

https://github.com/themesberg/flowbite-react/blob/b2640bcc70822e22b65a76e33b651ee291e12ec1/packages/ui/src/components/Dropdown/DropdownItem.tsx#L52-L55

By contrast, NavbarLink passes the event through:

https://github.com/themesberg/flowbite-react/blob/b2640bcc70822e22b65a76e33b651ee291e12ec1/packages/ui/src/components/Navbar/NavbarLink.tsx#L38-L41

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 in packages/ui/src/components/Dropdown/DropdownItem.tsx at lines 52-55 and compare its onclick handling with packages/ui/src/components/Navbar/NavbarLink.tsx at lines 38-41. Verify the Dropdown.Item callback receives the MouseEvent, including for stopPropagation use cases, and confirm the relevant component behavior after the change.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.