Closed shosaco closed 7 years ago
Hmm, that does seem strange. However, I think there's a simple solution here:
id = "tabs"
to the sidebarMenu()
call in the UI; updateTabItems(session, "tabs", "page2")
) at the end of your observeEvent()
.Here's your app with these two changes:
In an unrelated matter, one thing that took me a while to understand in your app was that you wanted to replace the same message in your dropdownMenu
over and over again (instead of adding more messages). If you actually want to add messages, instead of replacing them, your code needs to change a bit.
In case you're interested:
I think this closes this issue. If you have more questions, let me know and I can re-open.
Thank you. Of course I am adding messages, but for the sake of argument I simply replaced the message in the menu, since adding didn't add to demonstrating the problem.
However, I noticed this bug is the same as #229 and your proposed solution works in the special case that I have only 1 Tab from where I update the news. If there is Page2 and Page3 and both have a "Save"-Button which updates the header-Menu, the workaround doesn't work any more.
I will observe #229 to solve my problem, thanks!
Actually, my proposed solution could work if you don't hardcode the value, and instead make it whatever is currently selected: updateTabItems(session, "tabs", input$tabs)
(this still works as expected and it's more general).
This is the best answer I can give you (and the others) right now. It is a bit surprising this is happening, but I'm not currently working on this project right now, so I'd recommend using this workaround until I can understand the root of this issue.
Thanks a lot!
I have a ShinyDashboard Page with a notificationMenu inside the header. I update these notifications from inside a Page in the Dashboard. This works perfectly, but after updating the notification Items, the User is redirected to the first Tab of the App - which is a strange behaviour. I expected to stay at the current page, even after the update was triggered. Does anyone have an explanation?