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() doesn't work with list of panels #2927

Closed
hadley opened this issue Jun 17, 2020 · 1 comment · Fixed by #3315
Closed

tabsetPanel() doesn't work with list of panels #2927

hadley opened this issue Jun 17, 2020 · 1 comment · Fixed by #3315
Labels
UI toolkit Issues related to shiny UI

Comments

@hadley
Copy link
Member

hadley commented Jun 17, 2020

It would be nice if tabsetPanel() could work more easily with a list of panels, so you can program with it without needing to know do.call():

panels <- list(
  tabPanel("Plot", "plot"),
  tabPanel("Summary", "summary"),
  tabPanel("Table", "table")
)

ui <- fluidPage(
  tabsetPanel(panels)
)
shinyApp(ui, function(...) {})

ui <- fluidPage(
  do.call(tabsetPanel, panels)
)
shinyApp(ui, function(...) {})

This is somewhat related to #1928 (in the sense that if you fix issue you should also fix this one)

I think you have two main options to fix:

  • Automatically splice list inputs (like htmltools)
  • Use list2() instead of list to get explicit !!! splicing
@cpsievert
Copy link
Collaborator

Seems like the first option would be tricky to get right, especially for nested list situations, so I'd be in favor of option 2 (especially given that tabsetPanel() might be superseded within the next year or so)

@cpsievert cpsievert added the UI toolkit Issues related to shiny UI label Aug 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UI toolkit Issues related to shiny UI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants