-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Open
Labels
scope: chipChanges related to the chip.Changes related to the chip.type: bugIt doesn't behave as expected.It doesn't behave as expected.
Description
Steps to reproduce
Steps:
- Open this link to live example: https://stackblitz.com/edit/ob1sd6fc?file=src%2FDemo.tsx
- Click on
Open Popperbutton. - Click on the
xicon in the<Chip />.
Current behavior
The <Popper /> is not closed when clicking on the x icon if the <Chip />.
Expected behavior
Given the <ClickAwayListener /> in the <Popper />, the <Popper /> should be closed when clicking anywhere else, including when clicking on the x icon if the <Chip />.
Context
I use a <ClickAwayListener /> to close a <Popper />. Given that the <Chip /> event handler calls stopPropagation(), the click event never reaches the <ClickAwayListener />.
It seems like stopping propagation could be done by the onDelete handler that's passed into the Chip, rather than by default.
Your environment
npx @mui/envinfo
System:
OS: Linux 5.0 undefined
Binaries:
Node: 20.19.1 - /usr/local/bin/node
npm: 10.8.2 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
Browsers:
Chrome: Not Found
Firefox: Not Found
npmPackages:
@emotion/react: latest => 11.14.0
@emotion/styled: latest => 11.14.1
@mui/core-downloads-tracker: 7.3.5
@mui/material: latest => 7.3.5
@mui/private-theming: 7.3.5
@mui/styled-engine: 7.3.5
@mui/system: 7.3.5
@mui/types: 7.4.8
@mui/utils: 7.3.5
@types/react: latest => 19.2.2
react: latest => 19.2.0
react-dom: latest => 19.2.0
typescript: latest => 5.9.3
Search keywords: stopPropagation propagation Chip ClickAwayListener
MadQuint
Metadata
Metadata
Assignees
Labels
scope: chipChanges related to the chip.Changes related to the chip.type: bugIt doesn't behave as expected.It doesn't behave as expected.