ebailey78 / shinyBS

Twitter Bootstrap Components for Shiny
182 stars 47 forks source link

Lazy loading for bsModal #98

Open Neeratyoy opened 6 years ago

Neeratyoy commented 6 years ago

Hello, I am using a bsModal to serve a conditional pop-up. I am using scope resolution to call it as shinyBS::bsModal.

However, unless I explicitly load the shinyBS library, my RMarkdown notebook is not even knitting.

My hypothesis is that the misc.R script initializes the shinyBSDep variable which is used inside the bsModal function as a parameter to htmltools::attachDependencies() is not available when I lazy load bsModal

Is there a way to circumvent the library loading and just use bsModal through a scope resolution alone? Or will the next version account for this change?

ShinyFabio commented 3 years ago

I think I have the same issue. In my shiny app builded with {golem}, even if I set @import shinyBS both in server and in ui, the bsModals() simply doesn't work. If I manually load the package with library(shinyBS), then it works.

EDIT: since it works only if the package is fully loaded, just move "shinyBS" from the import field to the depends field (in the description file).