3

When I use the dateInput() in shiny use my phone, the keyboard will appear.enter image description here

It is work fine in My pc, but when I use the phone, keyboard will show up. Is there any method to stop keyboard pop up of phone? I also find the same question when I use the selectInput() function. Add the selectize = FALSE is useful in selectInput. Is there any other way to stop keyboard pop up in phone? The selectize = FALSE will make selection harder in mobile devices. `

library(shiny)

ui <- fluidPage(
  dateInput(
    "date",
    "What is your brithday?",
    
  ))
server <- function(input, output, session){}
  
  shinyApp(ui=ui, server=server)

`

Dou
  • 71
  • 5

1 Answers1

1

This answer suggests to add the readonly attribute. This can be done via htmltools::tagAppendAttributes or htmltools::tagQuery.

However, I currently can't test it:

library(shiny)
library(htmltools)

ui <- fluidPage(
  # tagAppendAttributes(dateInput(
  #   "date",
  #   "What is your brithday?",
  # ), readonly = "", .cssSelector = "input")
  
  tagQuery(dateInput(
    "date",
    "What is your brithday?",
  ))$find("input")$addAttrs(readonly = "")$allTags()
)
server <- function(input, output, session){}

shinyApp(ui=ui, server=server)
ismirsehregal
  • 30,045
  • 5
  • 31
  • 78