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

Dynamic sidebarMenu not working in 2.0.3 #234

Closed
pisistrato opened this issue Sep 16, 2021 · 2 comments
Closed

Dynamic sidebarMenu not working in 2.0.3 #234

pisistrato opened this issue Sep 16, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@pisistrato
Copy link

Just bumped into this, the following code (from ?renderMenu) generate and error
Warning: Error in renderUI: object 'expr' not found

library(shiny)
library(bs4Dash)

ui <- dashboardPage(
  dashboardHeader(title = "Dynamic sidebar"),
  dashboardSidebar(
    sidebarMenuOutput("menu")
  ),
  dashboardBody()
)

server <- function(input, output) {
  output$menu <- renderMenu({
    sidebarMenu(
      menuItem("Menu item", icon = icon("calendar"))
    )
  })
}

shinyApp(ui, server)
@DivadNojnarg
Copy link
Member

DivadNojnarg commented Sep 16, 2021

In the meantime, try this, which contains the missing piece of code causing the issue:

renderMenu <- function(expr, env = parent.frame(), quoted = FALSE, outputArgs = list()) {
 if (!quoted) {
    expr <- substitute(expr)
    quoted <- TRUE
  }
  shiny::renderUI(expr, env = env, quoted = quoted, outputArgs = outputArgs)
}

@DivadNojnarg DivadNojnarg added the bug Something isn't working label Nov 14, 2021
@DivadNojnarg
Copy link
Member

Fixed in CRAN 2.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants