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

Fixed repeated animation when dismissing Toast. #272

Closed
wants to merge 1 commit into from
Closed

Fixed repeated animation when dismissing Toast. #272

wants to merge 1 commit into from

Conversation

YJammak
Copy link
Contributor

@YJammak YJammak commented Aug 15, 2024

Fixed repeated animation when dismissing Toast in ActionButton callback function.

@kikipoulet
Copy link
Owner

@sirdoombox

@YJammak
Copy link
Contributor Author

YJammak commented Aug 16, 2024

When a delay is set to dismiss Toast, but Toast is manually dismissed in the ActionButton callback function before it is automatically dismissed, Toast will run the dismissing animation again.

@sirdoombox
Copy link
Collaborator

sirdoombox commented Aug 16, 2024

I can't seem to reproduce this one locally in any of the demo situations but it is entirely possible that two OnDismissed events being raised could cause the dismiss animation to be called twice, it'd have to be well timed though. I think this fix is a little rough I think it'd be better to actually check the manager to see if it's been dismissed instead of duplicating state. I think that API should be expanded to handle that case anyway.

Quick Edit: I think the actual source of this bug is when toasts are being recycled too quickly when they have a dismiss on delay, that delay isn't being disposed of and so it is being dismissed twice in that case. I'll look to fix that bug. This is a potential source of memory leaks so this fix definitely won't suffice.

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.

3 participants