Is there any way to scroll to the top of the page in ShinyDashboard on a button click?
I've added the following lines in ui.R
under dashboardSidebar(
:
useShinyjs(),
extendShinyjs(text = "shinyjs.button = function() {document.body.scrollTop = 0;}"),
and the following in server.R
under observeEvent(input$button, {
:
js$button()
This seems to work in the app preview in RStudio, but not in browser.