Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panning Plotly plot or Leaflet map in Shiny absolutePanel also moves panel #3752

Closed
AlexWaterboyBezzina opened this issue Dec 8, 2022 · 0 comments · Fixed by #3937
Closed

Comments

@AlexWaterboyBezzina
Copy link

AlexWaterboyBezzina commented Dec 8, 2022

Hi Shiny people,
First off just wanted to say absolutely incredible package it makes may life so much easier! Second I have run into this issue with interactive outputs inside absolute panels, such as leaflet maps or plotly plots, where when you try to pan, zoom or drag. The output loses most of its interactive features. I have also noticed if you set the interactive panel to fixed the mouse position is off to the left from where the mouse image actually appears when you try and hover over specific areas on the plot or map.

Plotly Example:

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)
    })
  }
)

Leaflet Example:

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() %>%
        addProviderTiles(providers$OpenStreetMap)
    }) 
  }
)

Is there someway to perhaps remove the draggability for specific areas of the panel?

Any help would be greatly appreciated :)

cpsievert added a commit that referenced this issue Oct 31, 2023
…t clicks on inputs and widgets from getting unneccesarily swallowed when absolutePanel(draggable = T)
cpsievert added a commit that referenced this issue Oct 31, 2023
…t clicks on inputs and widgets from getting unneccesarily swallowed when absolutePanel(draggable = T)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant