Snackbar slotProps.clickAwayListener not working
Open
Nobody has claimed this yet.
scope: toast
type: expected behavior
- Dominant language
- JavaScript
- Stars
- 99.1k
- Forks
- 32.5k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 106
Description
Steps to reproduce
Steps:
- Open this link to live example: https://stackblitz.com/edit/efjokxw3?file=src%2FDemo.tsx
- Click twice on any button.
Current behavior
On the second click, two things are happening:
- The clickAwayListener still works, despite disabling it
- The second click should display a snackbar, but the clickAwayListener overrides it
Expected behavior
- It should disable the clickAwayListener.
- Even if the clickAwayListener is not disabled (omitting
slotPropsentirely), it should not "override" displaying another snackbar.
Context
No response
Your environment
npx @mui/envinfo
System:
OS: Windows 10 10.0.19045
Binaries:
Node: 22.16.0 - C:\Program Files\nodejs\node.EXE
npm: 11.4.2 - C:\Program Files\nodejs\npm.CMD
pnpm: Not Found
Browsers:
Chrome: 137.0.7151.120
Edge: Chromium (137.0.3296.83)
Search keywords: snackbar clickaway clickawaylistener
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.