Skip to content

Commit

Permalink
Change key to improve animations
Browse files Browse the repository at this point in the history
  • Loading branch information
Duddino committed Oct 12, 2024
1 parent f685746 commit 19395a0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/alerts/Alerts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ watch(alerts, () => {
...previousAlert,
message: `${previousAlert.message}${countStr}`,
show,
// Store original message so we can use it as key.
// This skips the animation in case of multiple errors
original: previousAlert.message,
});
res.push(alert);
Expand Down Expand Up @@ -49,10 +52,9 @@ watch(alerts, () => {
<transition-group name="alert">
<div
v-for="alert of foldedAlerts.filter((a) => a.value.show)"
:key="alert.value.message + alert.value.created"
:key="alert.value.original"
>
<Alert
:key="alert.value.message"
:message="alert.value.message"
:level="alert.value.level"
@click="alert.value.show = false"
Expand Down

0 comments on commit 19395a0

Please sign in to comment.