notification icon indicating copy to clipboard operation
notification copied to clipboard

Unable to close notification since on release v4.5.0

Open donegjookim opened this issue 4 years ago • 6 comments

Our component library has been using rc-notification, and closing the notification started to not work since release v4.5.0. To be more specific, removeNotice method gets called, and I see that the notices array in the React state of rc-notification module removes the correct item. However, the state change does not get reflected in the UI, and the notification does not disappear from the screen.

Expected behavior:

  • Invoking "removeNotice" method with valid key correctly removes the notification from the UI

Current behavior:

  • Clicking on the close icon that calls "removeNotice" method removes the notice in the state correctly, but the notification does not disappear from the UI

donegjookim avatar Jan 06 '21 17:01 donegjookim

+1

Here is reproduce: https://codesandbox.io/s/condescending-buck-0ygl1?file=/src/App.tsx

If you upgrade the rc-notification package version, you will see notification not closing automatically.

I downgrade the package version to 4.4.0 and solved for me

dizefurkan avatar Jan 28 '21 12:01 dizefurkan

+1, seems like introduced on https://github.com/react-component/notification/commit/01c43b0d56f023845d7c57fa4054e5aab9f6e9b5 @zombieJ

Brooooooklyn avatar Feb 19 '21 03:02 Brooooooklyn

@afc163 Is this project still alive? Pin the rc-notification causes a duplicate packages issue since [email protected] -> [email protected] -> [email protected] and the other rc-xxx dependents [email protected]

Brooooooklyn avatar Feb 28 '21 08:02 Brooooooklyn

same issue i cannot close the button using Close Button

khanakia avatar Dec 24 '21 17:12 khanakia

Same problem here, even the simplest Demo from https://notification-react-component.vercel.app/demo/hooks doesn't work for me - notifications don't disappear. Using React 17.0.2 + rs-notifications 4.5.7.

rammaks avatar Feb 11 '22 19:02 rammaks

I found that after using removeNotice(key), the *-fade-leave class will be added to the corresponding div, and you can use *-fade-leave to control the display/hide of the notification content through css, which can solve the problem. We need to understand that the removeNotice method does not remove the notification html from the dom tree.

flycj avatar Mar 01 '22 05:03 flycj