Skip to content
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

Change the way shinyBS adds resource path #138

Open
ColinFay opened this issue Sep 29, 2021 · 1 comment
Open

Change the way shinyBS adds resource path #138

ColinFay opened this issue Sep 29, 2021 · 1 comment

Comments

@ColinFay
Copy link

Because of the way {shinyBS} adds its resources to {shiny}, it's impossible to build a package that wraps one of {shinyBS} functions.

https://github.com/ebailey78/shinyBS/blob/shinyBS3/R/misc.R#L1

For example, with the following dummy package : https://github.com/ColinFay/gloup

library(shiny)

ui <- function(request){
  tagList(
    fluidPage(
      h1("BsTest"),
      sliderInput(
        "bins",
        "Number of bins:",
        min = 1,
        max = 50,
        value = 30
      ),
      gloup::tp()
    )
  )

}

server <- function(input, output, session){

}

shinyApp(ui, server)

the tooltip won't show because {shinyBS} is not attached to the search path so the addResourcePath() is never called.

I would suggest using .onLoad instead, or switching for a resource attachment at the function level.

Thanks,
Colin

@ColinFay ColinFay changed the title Change the way shinyBS add resource path Change the way shinyBS adds resource path Sep 29, 2021
@gexijin
Copy link

gexijin commented Dec 11, 2022

I solved this issue with the showModal function, native of shiny. There is no need for using shinyBS now.

#Add this to the UI script:
actionButton("some_button", "Settings")

# Add this to the server script:	
observeEvent(input$some_button, {
  shiny::showModal(
    shiny::modalDialog(
      size = "l",
      p("something")
    )
  )
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants