Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to close notification since on release v4.5.0 #148

Open
donegjookim opened this issue Jan 6, 2021 · 6 comments
Open

Unable to close notification since on release v4.5.0 #148

donegjookim opened this issue Jan 6, 2021 · 6 comments

Comments

@donegjookim
Copy link

donegjookim commented Jan 6, 2021

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
@dizefurkan
Copy link

+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

@Brooooooklyn
Copy link

+1, seems like introduced on 01c43b0 @zombieJ

@Brooooooklyn
Copy link

@afc163 Is this project still alive? Pin the rc-notification causes a duplicate packages issue since rc-notification@4.4 -> rc-animation@3.x -> rc-utils@4.x and the other rc-xxx dependents rc-utils@5.x

@khanakia
Copy link

same issue i cannot close the button using Close Button

@rammaks
Copy link

rammaks commented Feb 11, 2022

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.

@flycj
Copy link

flycj commented Mar 1, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants