Skip to content

updateSelectizeInput does not update #130

@mmoisse

Description

@mmoisse

When using selectizeInput and updateSelectizeInput to update the choices, the update does not appear when using with a material_page.

An example:


shinyApp(
  material_page(fluidPage(
    material_button("add","Add 10"),
    selectizeInput("foo", "Foo", choices = c("a","b")),
    textOutput("text")
  )),
  function(input, output, session) {
    choices <- reactive({
      c("a", "b", (0:(10*as.numeric(input$add))))
    })
    output$text <- renderText({ choices() })
    observe({
      updateSelectizeInput(session, 'foo', choices = choices(), server = TRUE)
    })
  }
)

It gets resolved when adding the selectizeInput from server side


shinyApp(
  material_page(fluidPage(
    material_button("add","Add 10"),
    uiOutput("TT"),
    textOutput("text")
  )),
  function(input, output, session) {
    choices <- reactive({
      c("a", "b", (0:(10*as.numeric(input$add))))
    })
    output$text <- renderText({ choices() })
    output$TT<-renderUI({
      selectizeInput("foo", "Foo", choices = c("a","b"))
    })
    observe({
      updateSelectizeInput(session, 'foo', choices = choices(), server = TRUE)
    })
  }
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions