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

downloadBttn is only clickable on the label #271

Closed
Ljupch0 opened this issue Apr 23, 2020 · 3 comments
Closed

downloadBttn is only clickable on the label #271

Ljupch0 opened this issue Apr 23, 2020 · 3 comments

Comments

@Ljupch0
Copy link

@Ljupch0 Ljupch0 commented Apr 23, 2020

Hi, and thank you for the great package.

I am using downloadButtn with block=TRUE argument, with which I am stretching the button to fill the box it is in. However even though the button stretches, the only clickable part is the label of the button. Is there an easy way to stretch the link to cover the entire button and not just the label?

The exact button
downloadBttn(outputId = "filtered_csv", label = "Download CSV", style = "material-flat", color = "primary", size="sm", block = TRUE)

Thanks a lot!

@pvictor
Copy link
Member

@pvictor pvictor commented May 11, 2020

Hello,

Thanks, you're welcome :)

Yes this is confusing for users, I updated the function, if you re-install from GitHub, the whole button is clickable, e.g.:

library(shiny)
library(shinyWidgets)

ui <- fluidPage(
  tags$h2("Download bttn"),
  downloadBttn(
    outputId = "downloadData",
    style = "bordered",
    color = "primary", 
    block = TRUE
  )
)

server <- function(input, output, session) {
  
  output$downloadData <- downloadHandler(
    filename = function() {
      paste('data-', Sys.Date(), '.csv', sep='')
    },
    content = function(con) {
      write.csv(mtcars, con)
    }
  )
  
}

shinyApp(ui, server)

Victor

@Ljupch0
Copy link
Author

@Ljupch0 Ljupch0 commented May 15, 2020

Works! Small issue: When color="primary" the color of the button label is not white and hard to read. Fixed with a little css.

@Ljupch0 Ljupch0 closed this May 15, 2020
@pvictor
Copy link
Member

@pvictor pvictor commented May 18, 2020

Great! Ah yes, I fixed that on GitHub, this should be fine now:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.