Skip to content

Commit

Permalink
fix: re-render the slider when min and max state range changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vedhav committed Oct 11, 2024
1 parent 28e08af commit 51eb85b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions R/toggleable_slider.R
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,16 @@ toggle_slider_server <- function(id, is_dichotomous_slider = TRUE, step_slider =
shinyjs::toggle("slider_ui")
})

slider_range <- reactive({
list(
low = slider_states()$low,
high = slider_states()$high
)
})

output$slider_ui <- renderUI({
req(input$toggle >= 0)
req(slider_range())
state <- isolate(slider_states())
if (length(seq(state$slider_min, state$slider_max)) < 10) {
# The values should be index reference instead of actual values because of how we are calling the `sliderInput`
Expand Down

0 comments on commit 51eb85b

Please sign in to comment.