Closed Milko-B closed 6 months ago
Thanks! Here is a more minimal example with both popover()
and tooltip()
.
BTW, your example has an additional problem of multiple actionButton()
with the same id ("btn_pop"
).
library(shiny)
library(bslib)
ui <- page_navbar(
sidebar = list(
actionButton("insert_popover", "Insert popover"),
actionButton("insert_tooltip", "Insert tooltip")
),
id = "navbar",
nav_panel("Home", "Home page")
)
server <- function(input, output, session) {
observeEvent(input$insert_popover, {
nav_insert(
id = "navbar",
nav = nav_panel(
"Popover",
popover(
trigger = actionButton(
"show_popover",
"Click here for popover"
),
"Popover message",
title = "Popover title"
)
)
)
})
observeEvent(input$insert_tooltip, {
nav_insert(
id = "navbar",
nav = nav_panel(
"Tooltip",
tooltip(
trigger = actionButton(
"show_tooltip",
"Click here for tooltip"
),
"Tooltip message"
)
)
)
})
}
shinyApp(ui, server)
This issue has been automatically locked. If you have found a related problem, please open a new issue (with a reproducible example or feature request) and link to this issue. :raising_hand: Need help? Connect with us on Discord or Posit Community.
Describe the problem
Both
popover()
andtooltip()
don't work when inserting UI usingnav_insert()
. They are no longer interactable elements.In the reprex below, I have build a simple app which uses
page_navbar()
to initially show only one tab. Both the tooltip, and the popover work as intended. However, by pressing the button in the sidebar we add another page with the exact same UI. In this second page, both elements cease to work.Session Info