daattali / shinyalert

🗯️ Easily create pretty popup messages (modals) in Shiny
https://daattali.com/shiny/shinyalert-demo/
Other
241 stars 26 forks source link

vertically offset fileInput #83

Closed dleopold closed 6 months ago

dleopold commented 6 months ago

I am trying to put a fileInput() in a shinyalert modal, but the button and text input components of the file input are vertically offset. I imagine this is a simple styling fix, but I can't seem to get it right. Any ideas?

image

shinyalert(
        title = "Load Plate Map",
        text = tagList(
            fileInput(ns("plateMap"), label = NULL, multiple = FALSE, accept = ".csv")
        ),
        html = TRUE,
        showCancelButton = TRUE,
        confirmButtonText = "Load",
        size = "m"
)
dleopold commented 6 months ago

This css seems to fix the issue for my application:

.sweet-alert .form-group input[type="text"],
.sweet-alert .form-group button {
  height: 38px;
  margin: 0;
}
daattali commented 6 months ago

Thanks for solving it yourself. As you may have noticed, the sweetalert library automatically injects some CSS into .sweet-alert input (this isn't coming from the R package, it's coming directly from the third party javascript library).