daattali / shinyalert

🗯️ Easily create pretty popup messages (modals) in Shiny
https://daattali.com/shiny/shinyalert-demo/
Other
241 stars 26 forks source link

Shinyalert doesn't reset on close #60

Closed gdlr closed 2 years ago

gdlr commented 2 years ago

I'm creating a shiny app where the shinyalert displays different information depending on a prior selected input when an actionbutton is clicked. When I click once, it works great. However, when a different site is selected, two consecutive modals open: the first with the first, and now unselected, information, then the second clicked clicks information opens.

I can't figure out a way to reset the modal on a new click. Any hints? Can provide a reprex if the solution isn't obvious.

daattali commented 2 years ago

If there's a bug/issue please do provide a reprex. If this is more of a request for help, I probably won't be able to answer and you should ask on an online forum where the entire community can weigh in.

gdlr commented 2 years ago

I thought this was a bug but it might be caused by the way my app's reactivity is structured. I'll keep investigating...

gdlr commented 2 years ago

Yup, I had shinyalert wrapped in a renderUI() that was causing weirdness. I did this because I wanted the alert to only pop up after a click, but without that the actual alert works fine. Whoops...