Repository: rstudio/shiny

Issue #2254: Tick marks/labels don't update appropriately after updateSliderInput
Created: 2018-11-08T23:26:33Z
In this example we are using updateSelectInput and inputting an expression into the max argument, this is causing the steps to repeat, and the slider to be, what I am guessing, stuck on the previous steps. I am not sure if this is b/c you are not supposed to pass expressions to this function, or if it is part of this bug
library(shiny)

ui <- fluidPage(
  
  
  sidebarLayout(
    sidebarPanel(
      sliderInput(inputId="numberOfElements",
        label = "Number of elements to delete",
        #values updated dynamically on server.r
        min = 1, 
        max = 5, value = 1, step = 1),
      actionButton("button","Create Bug")
    ),
    
    mainPanel(
    )))

server <- function(input, output,session) {
  
  observeEvent(input$button,{
    
    updateSliderInput(session,
      "numberOfElements",
      max = 4)
  })
}

shinyApp(ui = ui, server = server)

Originally posted by @EthanStevensUSGS in #2159 (comment)

Duplicate issue #1499: updateselectinput label parameter doesn't work in observe or observeEvent
Created: 2016-12-10T15:13:34Z
The label parameter has no effect when calling updateSelectInput or updateSelectizeInput. I can see the code executing in the debugger and I've been able to change the list of choices, but the label of the selectinput never changes.
When the user picks a chart type (radio button) I want to change the labels of the measure category selectinputs as outlined below. The select inputs define both what type of data is being filtered and type of data is reflected on charts. Scatter, Histograms, etc..
ur.R
radioButtons(ns("chart_type"), "Chart Type",
choices=c("Histogram" = "histogram", "Scatter" = "scatter", "Box" = "box"),
selected = "histogram", inline = FALSE
),
selectInput(inputId = ns("measure_filter1"), label = "Measure Ranges", width = '100%', choices = screener_cols, selected = "age"),
numericInput(inputId = ns("measure_filter1_low"), label = NULL, value = NA),
numericInput(inputId = ns("measure_filter1_high"), label = NULL, value = NA),
sliderInput(ns("measure_filter1_mad"), "Median Absolute Deviations", min = 0, max = 10, value = 0, width = '100%'),
checkboxInput(inputId = ns("measure_filter1_na"), label = "Exclude Missing", value = FALSE),
actionButton(inputId = ns("measure_filter1_clear"), label = "Clear"),
hr(),
selectInput(inputId = ns("measure_filter2"), label = "Measure Ranges", width = '100%', choices = screener_cols, selected = "population"),
numericInput(inputId = ns("measure_filter2_low"), label = NULL, value = NA),
numericInput(inputId = ns("measure_filter2_high"), label = NULL, value = NA),
sliderInput(ns("measure_filter2_mad"), "Median Absolute Deviations", min = 0, max = 10, value = 0, width = '100%'),
checkboxInput(inputId = ns("measure_filter2_na"), label = "Exclude Missing", value = FALSE),
actionButton(inputId = ns("measure_filter2_clear"), label = "Clear")
server.R:
observeEvent(input$chart_type,
if (input$chart_type == "scatter") {
updateSelectInput(session = session, inputId = "measure_filter1", label = "Chart Measure - X Axis")
updateSelectInput(session = session, inputId = "measure_filter2", label = "Chart Measure - Y Axis")
}
else {
updateSelectInput(session = session, inputId = "measure_filter1", label = "Chart Measure")
updateSelectInput(session = session, inputId = "measure_filter2", label = "Measure Ranges")
}
)

Closing comment (2019-05-01T18:23:58Z): Thank you for the report. Closing as a duplicate of #2254