-
Notifications
You must be signed in to change notification settings - Fork 33
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
support for downloadButton()
#39
Comments
Hello @kyle-power! A download button is not supported by
|
Thanks @kyle-power for your question, and @jakubsob for a workaround! Starting downloads from React is a feature that we could add to shiny.react in a future release - I created issue Appsilon/shiny.react#11 to track it. |
Hi, all. But in my code, download button will open new page instead of download file. so I deleted almost every code to find what's problem, and found this. When download button is exist in So In my case, I replaced Below is minimal reproducible example. I'm even not sure what's different between Thanks. library(shiny)
library(shiny.fluent)
#>
#> Attaching package: 'shiny.fluent'
#> The following object is masked from 'package:shiny':
#>
#> runExample
library(shinyjs)
#>
#> Attaching package: 'shinyjs'
#> The following object is masked from 'package:shiny.fluent':
#>
#> runExample
#> The following object is masked from 'package:shiny':
#>
#> runExample
#> The following objects are masked from 'package:methods':
#>
#> removeClass, show
ui <- fluentPage(
useShinyjs(),
PrimaryButton.shinyInput(
"downloadButton",
text = "Download",
iconProps = list(iconName = "Download")
),
Stack(
style = "visibility: hidden;",
downloadButton("download", label = "")
)
)
server <- function(input, output, session) {
observeEvent(input$downloadButton, {
click("download")
})
output$download <- downloadHandler(
filename = function() {
paste("data-", Sys.Date(), ".csv", sep="")
},
content = function(file) {
write.csv(iris, file)
}
)
}
shinyApp(ui, server)
#>
#> Listening on http://127.0.0.1:3765 Created on 2023-09-12 with reprex v2.0.2 |
Workaround for PrimaryButton() as a download button
The text was updated successfully, but these errors were encountered: