rstudio / rstudio/flexdashboard

Reactive UI takes up entire column when used outside of sidebar

Open
#235 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

Reproducible Example

render_issue_mre.Rmd.txt

(Remove the .txt from the end - only included so GitHub would let me upload it)

Actual Behaviour

I have two UI elements being generated in a column (the problem doesn't exist when column is a sidebar but for my actual use case it I need them to be in an actual column). The first is reactive, coming from renderUI, the second is not.

Despite there being two UI elements generated by the code, only the first can be seen when rendered. The other is there in the HTML source, it's just hidden at the bottom the div it is contained in.

Expected Behaviour

Both UI elements should be visible, one below the other.

Possible Solution

At the moment, both the output of renderUI and renderPlot are found in divs with the CSS

.chart-stage .shiny-bound-output {
    width: 100% !important;
    height: 100% !important;
}

This means that the dropdown menu is in a div with 100% height. By adding a CSS file containing

.chart-stage .shiny-html-output {
    height: auto !important;
}

to my YAML header, the UI renders correctly without affecting the rendering of the plot. I'm not sure if this is generally applicable though - what else has property .chart-stage .shiny-html-output?

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 with the linked render_issue_mre.Rmd.txt example and inspect the .chart-stage .shiny-bound-output and .shiny-html-output CSS rules described in the issue. Reproduce the dashboard with reactive and non-reactive UI in one column, then verify both elements are visible one below the other without breaking the plot.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, r
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.