Make sidebarPanel autoscroll with mainPanel in shiny

Viewed 6023

I made a sidebarLayout in shiny which allows for scrolling in the mainPanel in case of overflow. The sidebarPanel's position remains fixed, such that it disappears as you scroll down the mainPanel. However, I'd like it to scroll with the mainPanel, so that the user doesn't need to scroll up again to change settings. How do I do this?

Basic setup:

ui = fluidPage(

  tags$style(type='text/css', 'body { overflow-y: scroll; }'),

  titlePanel(
    # ...
  ),

  sidebarLayout(

    sidebarPanel(
      # ...
      width = 3),

    mainPanel(
      # ...

      width = 9 )

  ))

server = function(input,output,session) {

  # ...

}

shinyApp(ui=ui, server=server)
1 Answers
Related