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

add transition callbacks to Toast #6674

Merged
merged 6 commits into from Aug 7, 2023

Conversation

ysshir
Copy link
Contributor

@ysshir ysshir commented Aug 3, 2023

Add animation callbacks to Toast.

Fixes #6152
The previous commit #6261 has not been merged.

src/Toast.tsx Outdated Show resolved Hide resolved
@kyletsang
Copy link
Member

Could you please add tests? Thanks

@ysshir
Copy link
Contributor Author

ysshir commented Aug 5, 2023

@kyletsang

Thank you for the review.

I've corrected the typo and written a test and an example. It works fine in the example, but the test failed. I noticed that the "onEntered" is not being called, but I couldn't figure out why.

Any ideas? Thanks.

@kyletsang
Copy link
Member

The toast tests uses fake timers so you need to manually advance the clock so code within functions like setTimeout will trigger. If you check the other tests, they call the tick function like clock.tick(250);. You'll need to do this within your test.

@ysshir
Copy link
Contributor Author

ysshir commented Aug 7, 2023

@kyletsang

Thank you for the advice!!
I believe the test is okay for now.

@kyletsang
Copy link
Member

Code and tests look good. The example currently isn't mobile friendly though. I'm thinking we probably don't need the example at all actually, since the props are pretty straight forward. Could you remove the example from this PR?

@kyletsang kyletsang merged commit 57836e2 into react-bootstrap:master Aug 7, 2023
12 of 13 checks passed
@kyletsang
Copy link
Member

Thanks!

@ysshir ysshir deleted the toast-transition branch August 7, 2023 05:29
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.

Add transition callbacks for Toast
2 participants