-
Notifications
You must be signed in to change notification settings - Fork 31
Improvement: support clear after #38
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
Improvement: support clear after #38
Conversation
|
@ken-kost sorry I'm coming back to this now, but can you remind me, did we have an issue discussing this one? I'm kind of hesitant to merge it cause its such a small bit of code that you can add to your projects if you want flashes to not last. |
|
Well, there is another issue where people seem to want this so I will go ahead with it, but I just want to test it locally first. |
|
not sure, might be some issue. I'll check tomorrow. 👍 |
|
My toasts never goes away on version 0.8, I tried to use the default duration as mentioned on docs, but it didn't work Would this PR help in this case? |
|
@srcrip There is a problem with this. The |
|
@luislhsc That doesn't sound related... could you open an issue with a repro? |
|
@ken-kost Hi, I have checked out the PR now and I see what you mean. The simplest thing to do would be to rely on JS to solve this. There's already a mechanism in place to clear the flashes from the frontend--it get's used to make toasts fall back to flashes properly across navigations by emitting a flash and a toast and just removing the duplicate flash from the frontend (I know that's kinda complicated). I can probably just implement it on this PR. |
|
ok I've implemented it now in the way I think makes the most sense. @ken-kost please test and let me know if it works ok for you. |
Looks good, I'll check it out tomorrow. 👍 |
|
I did git pull and started my project. I have It's not working for me. I plugged a console log into |
|
Also, unrelated: I suggest putting |
Yeah I set it like that when I had some issues with the formatter and thought specifying a different phoenix version may have had some changes to it... I can try and relax it and see if it all works fine. I know there was some formatter plugin changes in a recent LV version too I think?
Ah yes you're right, I added the new setting to the lower level components but not to |
|
ok @ken-kost you can try it out now |
|
Briefly I tried it and it still didn't work. 🤷 |
|
@ken-kost how about I make a commit on this branch with the demo, setting |
|
ok @ken-kost, if you have this branch locally, you can run |
|
@srcrip Okay, I tried again in my app - doesn't work. I started demo and toasted me and it didn't disappear after 3 seconds. |
|
@ken-kost can you confirm that you're testing these buttons: These are the ones in the demo that emit flashes, which are the only thing that would be affected by this feature... the "Toast Me" button at the top emits a |
oh, my bad. I'll try better. 🙇 |
|
Yep, I can confirm that it's working in demo. 👍 What I wanted is for it to be related to |
|
Yeah hooking into the library functions themselves is the best bet I think, then at least we can make flashes emitted from the library behave this way |

Option
clear_after, an integer representing milliseconds when to:clear_flashonself()