react-toastify icon indicating copy to clipboard operation
react-toastify copied to clipboard

Bug(Chromium only): onClose not fired if an interaction opens a new tab

Open An-dz opened this issue 5 years ago • 1 comments

What is the current behavior?

  1. Toast is set to not close on click
  2. There's a link, or an element with an onClick event, that opens in a new tab
  3. The link or element also dismisses the toast on an onClick event.
  4. 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

An-dz avatar Jun 05 '20 20:06 An-dz

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.

fkhadra avatar Jun 30 '20 10:06 fkhadra

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/

fkhadra avatar Oct 09 '22 19:10 fkhadra