The following code creates a shinydashboard with two menu items. Triggering the "shown" event on a menu item in javascript causes that tab to become selected. The reason this is problematic is because if the menu is hidden and then shown, it would be auto selected instead of keeping the current selection.
I just ran into the same problem and it found that removing the id from the sidebarMenu doesn't cause the tab to become selected anymore.
I don't know why this is, but it might help solving the problem.
(originally posted on daattali/shinyjs#148 and then https://github.com/rstudio/shiny/issues/1991 and now suspected to be a shinydashboard issue)
The following code creates a shinydashboard with two menu items. Triggering the "shown" event on a menu item in javascript causes that tab to become selected. The reason this is problematic is because if the menu is hidden and then shown, it would be auto selected instead of keeping the current selection.
@jcheng5 believes this line may be related