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

tabsetPanel and controlbarMenu don't allow type = "hidden" despite mention in documentation #189

Closed
zilch42 opened this issue Mar 12, 2021 · 1 comment

Comments

@zilch42
Copy link

zilch42 commented Mar 12, 2021

Hi there,

Both bs4Dash::tabsetPanel and bs4Dash::controlbarMenu return the following error when using type = "hidden"

Error in match.arg(type) : 'arg' should be one of “tabs”, “pills”

The documentation for both functions suggests that type = "hidden" is an option. I believe it is inheriting that part of the documentation from shiny.

type |
"tabs"Standard tab look
"pills"Selected tabs use the background fill color
"hidden"Hides the selectable tabs. Use type = "hidden" in conjunction with tabPanelBody() and updateTabsetPanel() to control the active tab via other input controls. (See example below)
(note that the documentation for those functions isn't currently showing any example of that functionality)

shiny::tabsetPanel does allow type = "hidden"

bs4Dash 2.0.0.90
shiny 1.6.0
R 4.0.2

minimal example that produces the error below:

if (interactive()) {
  library(shiny)
  library(bs4Dash)
  
  shinyApp(
    ui = dashboardPage(
      header = dashboardHeader(),
      sidebar = dashboardSidebar(),
      body = dashboardBody(),
      controlbar = dashboardControlbar(
        id = "controlbar",
        collapsed = FALSE,
        overlay = TRUE, 
        pinned = TRUE, 
        controlbarMenu(
          type = "hidden", 
          controlbarItem("item one"), 
          controlbarItem("item two")
        )
      ),
      title = "updateControlbar"
    ),
    server = function(input, output, session) {
      
    }
  )
}
@DivadNojnarg
Copy link
Member

You're right. They're using the old tabsetPanel function, when hidden didn't exist. I'll hardcode the corresponding help parameter.

Side note: shiny 1.7.0 is going to have native Bootstrap 4 panels so I'll wait before upgrading.

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

No branches or pull requests

2 participants