sever
sever copied to clipboard
sever disconnected screen doesn't hide tooltip info
I have a plot made with {echarts4r}
that uses a tooltip to display info. I also use sever()
to customize the disconnected screen. However, when the session is disconnected, the custom screen is displayed but I can also see the tooltip info of the plot previously displayed.
Example:
library(shiny)
library(sever)
library(echarts4r)
ui <- fluidPage(
use_sever(),
echarts4rOutput("test_plot")
)
server <- function(input, output){
sever()
output$test_plot <- renderEcharts4r({
cor(mtcars) %>%
e_charts() %>%
e_correlations(
order = "hclust",
visual_map = FALSE
) %>%
e_visual_map(
min = -1,
max = 1
) %>%
e_tooltip()
})
}
shinyApp(ui, server)
Reproduce:
- run the app in external window
- open in browser (button at the top of the external window)
- close the external window. This will display the disconnected screen in browser.
- move the mouse on the disconnected screen. The tooltip info is displayed whereas it shouldn't be.
If it matters, I use Firefox as browser.
I had not noticed, this can be fixed. I'll do that when I find the time.
I guess this has to do with CSS. I've seen that, when the disconnected screen appears, there are two elements: severed
and shiny-disconnected-overlay
. When hovering severed
, the tooltip info of the echarts
plot is not shown, as if severed
was completely overlapping the plot. However, when hovering shiny-disconnected-overlay
, the tooltip info appears. Therefore, I tried to apply the CSS rules of severed
to shiny-disconnected-overlay
but without success.
Another idea might be to modify/add a CSS class when the disconnected screen is displayed but I don't know how to do.