-
-
Notifications
You must be signed in to change notification settings - Fork 400
[notifications] Fix: #4959 transition on close #4960
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
base: master
Are you sure you want to change the base?
Conversation
- `close` now sets the notification's `open` prop to `false` before removing it from the queue.
Netlify deploy preview |
Thanks for contributing! Works, tested with https://codesandbox.io/p/devbox/nervous-fire-tyyrhm?workspaceId=ws_8roDQkQB8Gsa4Et8HYWgP6 @Janpot impacts the |
@Janpot I'm happy to refactor this if you have feedback btw! |
Instead of a timeout, I wonder if this can use onExited of the transition instead? |
That sounds much cleaner, thank you - I'll give it a go |
…d to remove Notifications from Queue
…ications queue - Also refactored `remove` to be consistent with the other context methods. Possible this version is easier for React to optimise?
@@ -90,10 +93,25 @@ function Notification({ notificationKey, open, message, options, badge }: Notifi | |||
|
|||
const props = React.useContext(RootPropsContext); | |||
const SnackbarComponent = props?.slots?.snackbar ?? Snackbar; | |||
|
|||
// Passing `onExited` through `externalSlotProps` here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Janpot This is not ideal, but I couldn't think of a better way that didn't involve rewriting mergeSlotProps
. Let me know if I'm missing something - I'm fairly new to React and mui.
is this going to be merged? |
Fixes: #4959