-
Notifications
You must be signed in to change notification settings - Fork 82
Weird behavior when using navbarMenu() and bs4SidebarMenu() simultaneously #394
Copy link
Copy link
Open
Labels
cynkra-dev-daycynkra developers daycynkra developers day
Description
In the below reprex, the shiny app should track "page" via the navbarTab() items in the navbar, and it should track "tab" via the bs4TabItem() items in the sidebar. The app prints the value of each of these as you make selections.
As you make selections in either section, both inputs get the same value. It looks like the input bindings are not separated (even though the id passed to the container functions are different).
library(shiny)
library(bs4Dash)
shinyApp(
ui = bs4DashPage(
header = bs4DashNavbar(
navbarMenu(
id = "page",
navbarTab(text = "Page 1", tabName = "page1"),
navbarTab(text = "Page 2", tabName = "page2")
)
),
sidebar = bs4DashSidebar(
id = "sidebar",
bs4SidebarMenu(
id = "tab",
menuItem(text = "Tab 1", tabName = "tab1"),
menuItem(text = "Tab 2", tabName = "tab2")
)
),
body = bs4DashBody(bs4TabItems(
bs4TabItem(tabName = "page1", "PAGE 1"),
bs4TabItem(tabName = "page2", "PAGE 2")
)),
footer = bs4DashFooter()
),
server = function(input, output, session) {
observe(message("page: ", input$page))
observe(message("tab: ", input$tab))
})
}
Using the following package versions:
bs4Dash_2.3.4, shiny_1.9.1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
cynkra-dev-daycynkra developers daycynkra developers day