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

disabled does not carry through to fileInput #249

Closed
bhogan-mitre opened this issue May 4, 2022 · 2 comments
Closed

disabled does not carry through to fileInput #249

bhogan-mitre opened this issue May 4, 2022 · 2 comments

Comments

@bhogan-mitre
Copy link

Similar to #223, the disabled function does not get carried through to the nested button. The input itself is disabled, so nothing happens when you click it. But it's a bit deceptive to users to have a clickable button that is disabled.

library(shiny)

ui <- fluidPage(
  shinyjs::useShinyjs(),
  shinyjs::disabled(
    fileInput("testup", "testupload")
  )
)

server <- function(input, output, session) {}

shinyApp(ui, server)

Screen Shot 2022-05-04 at 2 46 44 AM

Do you think it would work to cast the net a little wider and add span[btn] to the set of elements that are checked when enabling/disabling?
https://github.com/daattali/shinyjs/blob/master/inst/srcjs/shinyjs-default-funcs.js#L238

@daattali
Copy link
Owner

daattali commented May 5, 2022

It took a little bit more to fix this, but it should work now. Thanks for the report.

@bhogan-mitre
Copy link
Author

Great, thanks for the fix!

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

No branches or pull requests

2 participants