daattali / shinyjs

💡 Easily improve the user experience of your Shiny apps in seconds
https://deanattali.com/shinyjs
Other
734 stars 119 forks source link

Question regarding shingjs::show and hide js event handler #241

Closed Roshan84ya closed 2 years ago

Roshan84ya commented 3 years ago

hi daattali, while using these function in my shiny app shinyjs::show shinyjs::hide I see they are triggering the event 'shown.bs.modal', 'hidden.bs.modal' and that is causing some problem is there any way to handle this so that they won't trudger these events ? thanks

daattali commented 3 years ago

I don't know why that event gets triggered, it's not something I do explicitly. You can look at the code to see what happens when show/hide are called, the only event I trigger is the "shown" or "hidden" events and that's necessary so that shiny will know if something is visible/invisible for performance reasons (since shiny doesn't run computations on invisible elements). To can see this code here: https://github.com/daattali/shinyjs/blob/33a18dadefde57bcef0315f1fbb42569e8c63015/inst/srcjs/shinyjs-default-funcs.js#L176

Perhaps that causes the other events you me tinned to trigger as well, I don't know.