shinymanager icon indicating copy to clipboard operation
shinymanager copied to clipboard

fileInput(placeholder = "No file selected") is being overwritten by authenticated user name in Firefox

Open gdmcdonald opened this issue 4 years ago • 2 comments

After login, the default value of the placeholder text in a file upload UI element, "No file selected" is being over written by the username of the authenticated user. This only happens in Firefox, and not in Chrome or RStudio browser.

In Chrome (Version 94.0.4606.81 (Official Build) (x86_64)), Desired behavior: Screen Shot 2021-10-13 at 2 58 00 pm

In Firefox (93.0 (64-bit)), Undesired behavior: Screen Shot 2021-10-13 at 2 58 05 pm

Minimal Working Example:

library(shiny)
library(shinymanager)

#login data
credentials <- data.frame(
  user = c("demo_user"),
  password = c("password"),
  stringsAsFactors = FALSE
)

# Upload UI element
uploadUI <- function(id) {
  # Input: Select a file ----
  fileInput(inputId = "uploaded_files", 
            label = "Choose .zip file(s)",
            placeholder = "No file selected")
}

# Define UI for application
ui2 <- fluidPage(title = "Example", uploadUI(1))

# Wrap UI with secure_app
ui <- secure_app(ui = ui2, choose_language = F)

# server
server <- function(input, output) {
  # check_credentials returns a function to authenticate users
  res_auth <- secure_server(check_credentials(credentials))
}

# Run the application 
shinyApp(ui = ui, server = server)

gdmcdonald avatar Oct 13 '21 04:10 gdmcdonald

That's a good one 😆 0 ideas of what might be causing it tho...

pvictor avatar Nov 25 '21 17:11 pvictor