I would like to reset the action button on changing menuItems. I have three `menuItem` and an action button called `Submit`.
Example code is below
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(title = "Reset Action Button"),
dashboardSidebar(
sidebarMenu(id = "tabs",
menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")),
menuItem("Widgets", tabName = "widgets", icon = icon("th")),
menuItem("More", tabName = "more", icon = icon("th"))
),
actionButton('Submit', 'Submit button')
),
dashboardBody(
tabItems(
tabItem(tabName = "dashboard",
h2("Dashboard tab content")
),
tabItem(tabName = "widgets",
h2("Widgets tab content")
),
tabItem(tabName = "more",
h2("more tab content")
)
)
)
)
server <- function(input, output) {
observe(
print(input$Submit)
)
}
shinyApp(ui, server)
On switching to different menuItems, the action button should be reset to 0