'Refresh Shiny output and set focus to the desired part of page

I have tried to implement the solution proposed here: Not following URL Path Protocol

to separate all my plots in different files.

So basically I have radio buttons and based on user choice a different html file is loaded:

 else if (input$chap == "4" & input$cat == "2") {
    output$uiStub <- renderUI(tagList(             # a single-output stub ui basically lets you
      fluidPage(                                  #     move the ui into the server function
        fluidRow(
          column(12,
                 includeHTML("./html/mediapar.html")
          )
        ),
        uiOutput("pageStub")                     # loaded server code should render the
      )                                           #    rest of the page to this output$
    ))
  }

My problem is that every time a different file refresh (only one part of the page) the focus of page is lost and user has to scroll down again and again to get to the end of page where the choice can be made again and the plot shown.

fluidRow( style = "background-color:#FFFAFA00;",
            
            box(
              width = 12,
              solidHeader = TRUE,
              header = TRUE,
              background = NULL,
              ui <- uiOutput("uiStub") 
            )

Is there any workaround for this situation?

Kind Regards



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source