-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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): Reset autohide timer only if show or autohide changed #5220
fix(Toast): Reset autohide timer only if show or autohide changed #5220
Conversation
Co-authored-by: Jimmy Jia <tesrin@gmail.com>
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.
i cleaned up some of the memo/&c. stuff. it's not necessary to useMemo
calculations that return booleans – it really only matters for referential equality. but that does matter for context, so i added it there
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.
👍
Fixes #5173.
The autohide timer was being reset on every render, so I changed it only to reset if
show
orautohide
is changed. I noticed there was a note about not restarting the timer ifdelay
is changed so I left that as is.