2

I am trying to add an external URL in a shiny dashboard that uses the package bs4Dash but when I click in it their is no response. I have something similar to the example below. It does not work using newTab = FALSE or newTab = TRUE. Am I missing something or this is the way it is supposed to behave?

# NOT RUN {
## Only run this example in interactive R sessions
if (interactive()) {
  library(shiny)
  library(bs4Dash)
  
  # A dashboard header with 3 dropdown menus
  header <- dashboardHeader(
    title = "My dashboard"
  )
  
  sidebar <- dashboardSidebar(
    sidebarMenu(
      menuItem("My menu L1", href = "https://rinterface.github.io/bs4Dash/", newTab = FALSE),
      menuItem("My menu L2",
        menuSubItem("My submenu 1", href = "https://rinterface.github.io/bs4Dash/", newTab = TRUE)
      )
    )
  )
  
  shinyApp(
    ui = dashboardPage(
      header,
      sidebar,
      dashboardBody()
    ),
    server = function(input, output) { }
  )
}
# }
rjss
  • 935
  • 10
  • 23
  • Hi, I'm facing the same issue too. Can I kindly ask if you manage to find a solution for this? – Dwight Oct 21 '22 at 03:05

1 Answers1

0

@Dwight, I "solved" this issue via a hack. Basically, I started using the shinydashboard::menuItem for those particular instances. I think the author fix this and hopefully will be available in the next version (https://github.com/RinteRface/bs4Dash/issues/225).

shinydashboard::menuItem(
  text = "Help",
  href = "http://example.com"
)
rjss
  • 935
  • 10
  • 23