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

material_slider doesn't update in renderUI #114

Open
davidaarmstrong opened this issue Jun 7, 2020 · 0 comments
Open

material_slider doesn't update in renderUI #114

davidaarmstrong opened this issue Jun 7, 2020 · 0 comments

Comments

@davidaarmstrong
Copy link

Note in the app below that the material_slider doesn't ever update if it's included in the UI through a renderUI - uiOutput combination.

library(shiny)
library(shinydashboard)
library(htmltools)
library(shinymaterial)

ui <- material_page(
  title="Example",
  material_row( 
    material_column(width=3, 
                    material_card(
                      h5("Controls"),
                      br(),
                      uiOutput("bins")
                    )
    ),
    material_column(width=9, 
                  material_card(
                      p("Note that the output never changes from NULL when you move the slider"),
                      br(),
                      verbatimTextOutput("myBins"),
                    )
    )
  )
)
server <- function(input, output, session) { 
  library(shinymaterial)
  output$bins <- renderUI({
    material_slider("nbins", "Number of Bins", min_value = 2, max_value = 25, initial_value = 10)
  })
  
  output$myBins <- renderPrint({
    input$nbins
  })
  
}

shinyApp(ui, server)
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

1 participant