shinymanager
shinymanager copied to clipboard
fileInput(placeholder = "No file selected") is being overwritten by authenticated user name in Firefox
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:

In Firefox (93.0 (64-bit)), Undesired behavior:

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)
That's a good one 😆 0 ideas of what might be causing it tho...