If we drop all null or empty values in items before doing tagAssert, we can allow modular code such as this to function properly:
dashboardHeader(
title = "Title",
if (my_condition) dropdownMenu(...) else NULL, # Only include dropdown if a condition is satisfied (e.g. read this from a config file)
dropdownMenu(...) # Other dropdown
)
This behaviour would be consistent with dashboardBody() (this relies on shiny::tag(...))
I'll gladly do a PR if the feature is considered useful for others as well.
https://github.com/rstudio/shinydashboard/blob/9158ee083cb852922c65e82c292271046f85b9ee/R/dashboardHeader.R#L90-L91
If we drop all null or empty values in
items
before doing tagAssert, we can allow modular code such as this to function properly:This behaviour would be consistent with
dashboardBody()
(this relies onshiny::tag(...)
)I'll gladly do a PR if the feature is considered useful for others as well.