-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix(Toast): resume timers if no longer over toast region after a toast is removed #7681
base: main
Are you sure you want to change the base?
Conversation
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.
We should get a test for this
} | ||
} | ||
prevToastCount.current = currentCount; | ||
}, [ref, state]); |
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.
}, [ref, state]); | |
}, [ref, state.visibleToasts, state.resumeAll]); |
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.
eslint[react-hooks/exhaustive-deps]
still wants state
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.
huh.... ok then i guess, that's so weird
could always pull them off the state object beforehand, the unfortunate part is that the state object will likely always be new, at least, until the react compiler can run on that file
return () => { | ||
document.removeEventListener('pointermove', onPointerMove); | ||
}; | ||
}, [state.visibleToasts.length]); |
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.
}, [state.visibleToasts.length]); | |
}, [state.visibleToasts]); |
just in case there's some situation where one is removed and one is added at the same time?
Closes #7024
✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project: