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

fix(Toast): Reset autohide timer only if show or autohide changed #5220

Merged
merged 6 commits into from
Jun 22, 2020

Conversation

kyletsang
Copy link
Member

Fixes #5173.

The autohide timer was being reset on every render, so I changed it only to reset if show or autohide is changed. I noticed there was a note about not restarting the timer if delay is changed so I left that as is.

src/Toast.js Outdated Show resolved Hide resolved
Co-authored-by: Jimmy Jia <tesrin@gmail.com>
src/Toast.js Outdated Show resolved Hide resolved
Copy link
Member

@taion taion left a 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

@kyletsang kyletsang requested a review from mxschmitt June 18, 2020 17:47
@taion taion requested review from bpas247 and jquense June 18, 2020 18:09
Copy link
Member

@mxschmitt mxschmitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kyletsang kyletsang merged commit 20b532d into react-bootstrap:master Jun 22, 2020
@kyletsang kyletsang deleted the fix/toast-autohide-timer branch June 22, 2020 19:29
brianackley001 added a commit to brianackley001/budgeting-app-client that referenced this pull request Mar 28, 2024
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

Successfully merging this pull request may close these issues.

Toasts - Stacked Toasts with autohide delays does not work correctly in prod build.
3 participants