Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(downloadButton): Return tag directly #2672

Merged
merged 6 commits into from Jan 30, 2024
Merged

Conversation

fennovj
Copy link
Contributor

@fennovj fennovj commented Oct 18, 2019

Fixes #2392

The downloadButton() has a very simple longstanding issue where it does not return the tag explicitly.

It is likely this issue does not show in the normal shiny app because it uses a different method to capture the output, such as tag <- downloadButton(...)

However directly calling downloadButton(...) didn't not work correctly, which means rmarkdown documents didn't show the downloadButton correctly.

Minimal code example: Without the fix, only the first downloadbutton is shown. With the fix, both download buttons are shown.

---
output: html_document
runtime: shiny
---

```{r results="test"}
(shiny::downloadButton("hello", "world"))

shiny::downloadButton("hello", "world")
```

Fixes rstudio#2392

The downloadButton has a very simple longstanding issue where it does not return the tag explicitly. This is only an issue depending on how the function is called.
For example: `tag <- downloadButton(...)` has always worked fine, as has `anotherFunction(downloadButton(...))`.
It is likely this issue does not show in the normal shiny app because it uses one of these methods.
However `downloadButton(...)` didn't not work correctly, which means rmarkdown documents didn't show the downloadButton correctly.
@CLAassistant
Copy link

CLAassistant commented Oct 18, 2019

CLA assistant check
All committers have signed the CLA.

@fennovj fennovj changed the title Fix downloadButton() not rendering in rmarkdown documents Fix downloadButton() not rendering in rmarkdown documents, fxes #2392 Oct 18, 2019
@schloerke schloerke added this to the 1.7 milestone Feb 11, 2021
@gadenbuie gadenbuie changed the title Fix downloadButton() not rendering in rmarkdown documents, fxes #2392 fix(downloadButton): Return tag directly Nov 8, 2023
@gadenbuie gadenbuie removed this from the 1.7 milestone Nov 8, 2023
@LiNk-NY
Copy link

LiNk-NY commented Jan 29, 2024

Thanks @fennovj ! It looks like you'd need to sign the CLA

@fennovj
Copy link
Contributor Author

fennovj commented Jan 30, 2024

Thanks @fennovj ! It looks like you'd need to sign the CLA

Hi @LiNk-NY. Cool that this PR may be merged after all! :) I signed the CLA

@gadenbuie
Copy link
Member

Thank you @fennovj for the contribution and for your patience!

@gadenbuie gadenbuie merged commit fff2836 into rstudio:main Jan 30, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

downloadButton doesn't render in rmarkdown
6 participants