It doesn’t replay the animation if you update the same element in the current LV connection, I think, since the class was already placed on the earliest update.
One way to fix this is have the LV send itself a message Process.send_after(self(), :clear_flash, 500) right before returning assigns. The 500 ms delay is so the animation can finish, which is slightly smelly but probably good enough for many cases.
What I’d really like to do is make the removal 100% synced with the animation finishing.
Other approaches I haven’t tried:
- CSS animation finishes and triggers a state update somehow? Probably hacky.
- LV/JS bindings/commands?
- Alpine.js or similar?






















