rstudio / rstudio/flexdashboard

vertical_layout: scroll and page refreshes

Open
#218 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
848
Forks
298
PR merge metrics
No merged PRs in 30d

Description

I'm experiencing an odd behavior when using vertical_layout: scroll with paged content. After a navbar button for a page has been clicked (even if there is only one page, a button must be clicked), and the document is refreshed in the browser, the page will automatically scroll up slightly, hiding the top of the content under the navbar. This doesn't happen on the initial document load... only after the "button clicked, document reload" sequence. Also, it only happens if the content of the page is longer than the screen.

I have observed this both in Chrome and Firefox on Linux.

Here is a MWE which exhibits this behavior:

---
title: Minimal Working Example
output: 
  flexdashboard::flex_dashboard:
    self_contained: true
    vertical_layout: scroll
---

```{r setup, include=F}
library(kableExtra)
```

Foo
=======================================================================

### Cars

```{r, echo=F}
    kable( mtcars, "html", escape=F) %>%
    kable_styling(bootstrap_options=c("hover","condensed","striped"))
```

Edit:

Here are two screenshots: the first directly after opening the page, and the second immediately after clicking the navbar button and refreshing the page in the browser.

initial
after

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the supplied MWE with flexdashboard's vertical_layout: scroll in Chrome or Firefox. Compare the initial load with the navbar-click-then-refresh sequence for content longer than the screen; done means refreshing no longer scrolls the page up beneath the navbar.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, r
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.