title: Panning leaflet map or Plotly plot in draggable Shiny panel also moves panel
body: <p>When using a leaflet map inside a draggable Shiny panel (e.g. absolutePanel with draggable=T), panning the leaflet map with the mouse also drags the Shiny panel.</p>
  
  <p>Is there a way to prevent panning the map with the mouse from also moving the Shiny panel?</p>
  
  <p>I think it is similar to this resolved issue:
  <a href="https://github.com/rstudio/shiny/issues/711" rel="nofollow noreferrer">https://github.com/rstudio/shiny/issues/711</a></p>
  
  <p>and there are DOM event functions related to click propagation in leaflet.</p>
  
  <h1>Edit:</h1>
  
  <p>This also occurs with Plotly plots and may be a more general issue than I initially realized. The question has been edited to include plotly.</p>
  
  <h1>Leaflet example:</h1>
  
  <pre class="lang-r prettyprint-override"><code>library(leaflet)
  library(shiny)
  
  shinyApp(
    ui = fluidPage(
      absolutePanel(draggable=T, width='600px', wellPanel(
          fluidRow(leafletOutput('map'))
      ))
    ),
    server = function(input, output, session) {
      output$map=renderLeaflet({
        leaflet() %&gt;%
        addProviderTiles(providers$OpenStreetMap)
      }) 
    }
  )
  </code></pre>
  
  <p>Setting the dragging option to F in leaflet resolves the problem, but makes the map less useful.</p>
  
  <pre class="lang-r prettyprint-override"><code>shinyApp(
    ui = fluidPage(
      absolutePanel(draggable=T, width='600px', wellPanel(
          fluidRow(leafletOutput('map'))
      ))
    ),
    server = function(input, output, session) {
      output$map=renderLeaflet({
        leaflet(options=leafletOptions(dragging=F)) %&gt;%
        addProviderTiles(providers$OpenStreetMap)
      }) 
    }
  )
  </code></pre>
  
  <h1>Plotly example</h1>
  
  <p>Zoom, pan, and select plot interactions all cause the draggable panel to move.</p>
  
  <pre class="lang-r prettyprint-override"><code>library(plotly)
  library(shiny)
  
  shinyApp(
    ui = fluidPage(
      absolutePanel(draggable=T, width='600px', wellPanel(
          fluidRow(plotlyOutput('plot'))
      ))
    ),
    server = function(input, output, session) {
      output$plot=renderPlotly({
        plot_ly(data=mtcars, type='scatter', mode='markers', x=~hp, y=~mpg, name=~cyl)
      })
    }
  )
  </code></pre>