bslib icon indicating copy to clipboard operation
bslib copied to clipboard

safari renders a credentials dialog for numericInput() in bs_theme_preview()

Open cpsievert opened this issue 3 years ago • 4 comments

Interestingly, if you remove the passwordInput(), the dialog goes away. This is also problem for vanilla shiny, see that with:

shiny::shinyAppDir(system.file("themer-demo", package = "bslib"))
Screen Shot 2021-01-16 at 7 44 31 PM

cpsievert avatar Jan 17 '21 15:01 cpsievert

Also, it appears Firefox also wants to think that the numericInput() is some sort of password

Screen Shot 2021-01-16 at 8 00 45 PM

cpsievert avatar Jan 17 '21 15:01 cpsievert

Here's a minimal example:

library(shiny)
ui <- fluidPage(
  numericInput("foo", "number", value = 0),
  passwordInput("bar", "password", "fo"))
)
server <- function(input, output, session) {}
shinyApp(ui, server)

cpsievert avatar Jan 17 '21 15:01 cpsievert

Seems we could do something like this

input[type="number"]::-webkit-contacts-auto-fill-button {
  visibility: hidden;
  display: none !important;
  pointer-events: none;
  position: absolute;
  right: 0;
}

https://stackoverflow.com/a/39885072/1583084

cpsievert avatar Jan 17 '21 16:01 cpsievert

There's no need to change this in general in bslib or Shiny, since it's desirable behavior in most cases. It does make sense to disable it for the demo app, though.

wch avatar Jan 17 '21 16:01 wch