When using userOutput and shinydashboard::sidebarMenuOutput in a certain combination, I observed that the userOutput was not displayed. I tried to figure out under which circumstances this happens.
sidebarMenuOutput nested inside a module breaks the dynamic header. In this case the content for dashboardUser is not displayed. In the page inspector I see that the <li> element that should contain the dashboardUser has class shiny-bound-input but no children. Therefore I suspect there is an issue with the output binding.
When using
userOutput
andshinydashboard::sidebarMenuOutput
in a certain combination, I observed that theuserOutput
was not displayed. I tried to figure out under which circumstances this happens.sidebarMenuOutput
on same level works:Complete App
```r library(shiny) library(shinydashboardPlus) library(shinydashboard) container_ui <- function(id) { ns <- shiny::NS(id) shinydashboardPlus::dashboardPage( header = shinydashboardPlus::dashboardHeader( userOutput(ns("user")) ), sidebar = shinydashboardPlus::dashboardSidebar( shinydashboard::sidebarMenuOutput(ns("sidebar")) ), body = dashboardBody() ) } container_server <- function(id) { shiny::moduleServer( id, function(input, output, session) { output$sidebar <- shinydashboard::renderMenu({ shinydashboard::sidebarMenu( shinydashboard::menuItem( text = "Menu Item" ) ) }) output$user <- renderUser({ dashboardUser( name = "Divad Nojnarg", image = "https://adminlte.io/themes/AdminLTE/dist/img/user2-160x160.jpg", title = "shinydashboardPlus", subtitle = "Author", footer = p("The footer", class = "text-center"), fluidRow( dashboardUserItem( width = 6, socialButton( href = "https://dropbox.com", icon = icon("dropbox") ) ), dashboardUserItem( width = 6, socialButton( href = "https://github.com", icon = icon("github") ) ) ) ) }) } ) } shinyApp( ui = container_ui("container"), server = function(input, output) { container_server("container") } ) ```sidebarMenuOutput
nested inside a module breaks the dynamic header. In this case the content fordashboardUser
is not displayed. In the page inspector I see that the<li>
element that should contain thedashboardUser
has classshiny-bound-input
but no children. Therefore I suspect there is an issue with the output binding.Complete App
```r library(shiny) library(shinydashboardPlus) library(shinydashboard) sidebar_menu_ui <- function(id) { ns <- shiny::NS(id) shinydashboard::sidebarMenuOutput(ns("sidebar")) } sidebar_menu_server <- function(id) { shiny::moduleServer( id, function(input, output, session) { output$sidebar <- shinydashboard::renderMenu({ shinydashboard::sidebarMenu( shinydashboard::menuItem( text = "Menu Item" ) ) }) } ) } container_ui <- function(id) { ns <- shiny::NS(id) shinydashboardPlus::dashboardPage( header = shinydashboardPlus::dashboardHeader( userOutput(ns("user")) ), sidebar = shinydashboardPlus::dashboardSidebar( sidebar_menu_ui(ns("sidebar")) ), body = dashboardBody() ) } container_server <- function(id) { shiny::moduleServer( id, function(input, output, session) { output$user <- renderUser({ dashboardUser( name = "Divad Nojnarg", image = "https://adminlte.io/themes/AdminLTE/dist/img/user2-160x160.jpg", title = "shinydashboardPlus", subtitle = "Author", footer = p("The footer", class = "text-center"), fluidRow( dashboardUserItem( width = 6, socialButton( href = "https://dropbox.com", icon = icon("dropbox") ) ), dashboardUserItem( width = 6, socialButton( href = "https://github.com", icon = icon("github") ) ) ) ) }) sidebar_menu_server("sidebar") } ) } shinyApp( ui = container_ui("container"), server = function(input, output) { container_server("container") } ) ```The following error appears in the JS console:![jserror](https://user-images.githubusercontent.com/36515290/103133091-c21c0b80-46a8-11eb-85d7-b1caaf974348.png)
I don't observe this issue using the current CRAN release.