Reproduction
NA
Describe the bug
One of the ways to dismiss a Dialog is to click the "background" outside of the DialogContent. However, if you click the back button on a mouse (usually button 4) while hovering over the background it will dismiss the dialog, but then also trigger a browser back.
Clicking the mouse back button when hovering over the DialogContent does not do this.
In my case, my dialogs act as inline editors and are driven by the current route. So in my case, dismissing the dialog goes back to the parent route, but then the back button click goes back to the edit route, causing the dialog to show up again; at first I thought my route behaviour was broken.
Is it safe to limit which mouse buttons trigger a click event on the background to dismiss it?
System Info
System:
OS: Linux 6.8 Ubuntu 24.04.3 LTS 24.04.3 LTS (Noble Numbat)
CPU: (16) x64 13th Gen Intel(R) Core(TM) i5-1340P
Memory: 23.34 GB / 31.06 GB
Container: Yes
Shell: 5.2.21 - /bin/bash
Binaries:
Node: 22.22.2 - /home/ian/.nvm/versions/node/v22.22.2/bin/node
npm: 10.9.7 - /home/ian/.nvm/versions/node/v22.22.2/bin/npm
pnpm: 11.1.1 - /home/ian/.nvm/versions/node/v22.22.2/bin/pnpm
bun: 1.1.38 - /home/ian/.bun/bin/bun
Browsers:
Chrome: 147.0.7727.55
Firefox: 150.0.3
Firefox Developer Edition: 150.0.3
Contributes
- I am willing to submit a PR to fix this issue