react-toastify
react-toastify copied to clipboard
Bug(Chromium only): onClose not fired if an interaction opens a new tab
What is the current behavior?
- Toast is set to not close on click
- There's a link, or an element with an onClick event, that opens in a new tab
- The link or element also dismisses the toast on an onClick event.
- onClose will not be called.
Sandbox: https://codesandbox.io/s/reverent-goldberg-jf4y7?file=/src/App.js
What is the expected behavior?
I expected that onClose would always fire when dismissing the toast.
Versions
React v16.9.35 Arch Linux x64 Chromium v83
Hey @An-dz, Thank you for reporting the issue. It works fine with Firefox but not with chromium based browser. So I'll probably have to check if the chromium team has already something for that.
onClose callback will be removed in the next major release. It's replaced by the toast.onChange https://fkhadra.github.io/react-toastify/listen-for-changes/