Three sliders synchronization without triggering a loop

I'm trying to make three sliders synchronously update each other's values. However, the problem is that they trigger a loop when I slide one of them slowly.

here is the code:

  slider_ids <- c("slider_1", "slider_2", "slider_3")

  update_sliders <- function(changed_slider) {
    new_value <- input[[changed_slider]]
    other_sliders <- slider_ids[slider_ids != changed_slider]

    lapply(other_sliders, function(slider_id) {
      updateSliderInput(session, slider_id, value = new_value)
    })

  }

  lapply(slider_ids, function(slider_id) {
    observeEvent(input[[slider_id]], {
      update_sliders(slider_id)
    })
  })

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.