Closed daranzolin closed 1 year ago
Hi @daranzolin, could you provide me a quick reprex that I can reproduce this behavior?
Sure, see the source code below. I've observed this behavior in both Firefox and Chrome. Clicking the download button jumps to the top of the page.
---
title: "downloadthis reprex"
format: html
editor: visual
---
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
```{r}
library(downloadthis)
mtcars %>%
download_this(
output_name = "mtcars data set",
output_extension = ".csv",
button_label = "Download data",
button_type = "warning",
has_icon = TRUE,
icon = "fa fa-save"
)
Update: this Stackoverflow solution works for single pages, but not when the output includes tabs.
Edit: this solution does work for me, I just had to loop through each button and update the href in button.html
.
+1 to this. Is there an update to this issue?
I have a long Quarto report with several
downloadthis
buttons. The buttons work great, but the window jumps to the top of the page after clicking, annoying some of my users. Is there someway to adjust the href argument here to prevent this behavior?https://github.com/fmmattioni/downloadthis/blob/0718d0c0ae74868eb8ba42c72c18817d59cd1914/R/download.R#L268-L270