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 visible toast messages flickering when one disappears #4749

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

absidue
Copy link
Member

@absidue absidue commented Mar 6, 2024

Fix visible toast messages flickering when one disappears

Pull Request Type

  • Bugfix

Description

As we were previously using the array index for the :key in the toast's v-for, it meant than when a toast disappears, all of the toasts would get re-rendered by Vue, as the items would be at different indexes, causing the CSS animations to trigger again which results in the flickering effect.

This pull request assigns each toast a unique ID, which means that when the toasts array changes, the keys don't change, so Vue knows it only needs to update the toasts that are being added or removed.

Screenshots

Testing

Click the Set Current Instance as Default and Clear Default Instance buttons in the general settings section to create a bunch of toasts. Watch the toasts as some of them start disappearing, after this pull request they should no longer flicker.

Desktop

  • OS: Windows
  • OS Version: 10
  • FreeTube version: 0.19.2

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) March 6, 2024 18:31
@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Mar 6, 2024
@FreeTubeBot FreeTubeBot merged commit 064170b into FreeTubeApp:development Mar 7, 2024
5 checks passed
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Mar 7, 2024
@absidue absidue deleted the fix-toast-flickering branch March 7, 2024 15:36
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.

5 participants