rstudio / rstudio/flexdashboard

renderText scrollbar even with css command won't work inside column

Open
#175 2 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

For me to currently add a scrollbar to renderText (using renderUI), I have to do the following gymnastics:

---
title: "my title"
runtime: shiny
output:
   flexdashboard::flex_dashboard:
   orientation: rows
   theme: cerulean
   source_code: embed
---

```{r global, include=FALSE}
library(tidyverse)
# more code here
```

# Sidebar {.sidebar data-width=150}

```{r}
# stuff on sidebar
```
# Page {.hidden}

## Text

```{r}
scroll_css <- "<style> #section-text {overflow-y: scroll;} </style>"
renderUI({
  to_print <- str_c(scroll_css, some_line, "<br>", some_other_line) 
  htmltools::HTML(to_print)
})
```

However, if instead of ## Text above I did

## Column

### Text

```{r}
scroll_css <- "<style> #section-text {overflow-y: scroll;} </style>"
renderUI({
  to_print <- str_c(scroll_css, some_line, "<br>", some_other_line) 
  htmltools::HTML(to_print)
})
```

scroll bar (as determined by the css styling line) will no longer work

I would be grateful if (a) renderText({ ... }) would actually produce a scrollbar automatically when the text was too long, or somehow the above problem would be fixed.

Overall, using flexdashboard is appealing but the package seems to be pretty erratic, controls don't alway render, etc. So hopefully there will be enough time to push for bug fixing here.

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 issue's flexdashboard example using renderUI, the nested Column/Text layout, and the #section-text CSS rule. Compare the top-level Text case with the nested case and determine whether the scrollbar behavior can be corrected; done means the CSS-based scrollbar works inside the nested column without the extra workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, r
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.