Hey there,
it appears that flash messages don't disappear like toasts do, which makes for a somewhat confusing UX. I tested LiveToast in my project and if I stay in one LiveView and show a toast, it disappears after 6 seconds as expected. However, if I use put_toast/3 followed by a push_navigate/2, a Flash message with data-component="flash" appears which looks exactly like my toast, but it doesn't disappear after 6s.
After a morning of debugging this, it appears that LiveToast doesn't auto-hide flash messages, only toasts.
Flashes have a data-duration="0" by default, which means they'll stay indefinitely.
But even if I could set a duration for them, the JS part would ignore them:
My assumption is that LiveToast doesn't remove flashes because LiveView also doesn't do that. However, this becomes confusing when a Toast does disappear, but a Flash does not, even though they look the same. May I suggest that you hide Flashes just like you hide Toasts? That'd be much appreciated!
Hey there,
it appears that flash messages don't disappear like toasts do, which makes for a somewhat confusing UX. I tested LiveToast in my project and if I stay in one LiveView and show a toast, it disappears after 6 seconds as expected. However, if I use
put_toast/3followed by apush_navigate/2, a Flash message withdata-component="flash"appears which looks exactly like my toast, but it doesn't disappear after 6s.After a morning of debugging this, it appears that LiveToast doesn't auto-hide flash messages, only toasts.
Flashes have a
data-duration="0"by default, which means they'll stay indefinitely.live_toast/lib/live_toast/components.ex
Line 132 in 5d56f7b
But even if I could set a duration for them, the JS part would ignore them:
live_toast/assets/js/live_toast/live_toast.ts
Line 233 in 5d56f7b
My assumption is that LiveToast doesn't remove flashes because LiveView also doesn't do that. However, this becomes confusing when a Toast does disappear, but a Flash does not, even though they look the same. May I suggest that you hide Flashes just like you hide Toasts? That'd be much appreciated!