Skip to content

Commit 2390e4c

Browse files
committed
Disable keyboard when user chooses inputs on mobile
1 parent 31cb80b commit 2390e4c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

app/app.R

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ library(shiny.tailwind)
33
library(shiny.i18n)
44
library(dplyr)
55
library(cookies)
6+
library(htmltools)
67

78
source("global.R")
89

@@ -30,10 +31,12 @@ ui <- add_cookie_handlers(
3031
a(href = "#", class="btn btn-ghost text-xl",
3132
tags$div(class = "title-comb", icon("check-to-slot"), tags$h1(i18n$t("Greek Elections App"))))),
3233
div(class = "flex-none gap-x-3",
33-
selectInput('selected_language',width = "10em",
34+
htmltools::tagAppendAttributes(selectInput('selected_language',width = "10em",
3435
label = "",
3536
choices = c("English" = "en", "Ελληνικά" = "el"),
36-
selected = i18n$get_key_translation())
37+
selected = i18n$get_key_translation()),
38+
39+
readonly = "", .cssSelector = "input")
3740
),
3841
),
3942
div(class = "wrapper-card",
@@ -390,7 +393,7 @@ server <- function(input, output, session) {
390393

391394
observeEvent(input$selected_language, {
392395
output$tab_content <- renderUI({
393-
selectInput(
396+
htmltools::tagAppendAttributes(selectInput(
394397
inputId = "elect_systems",
395398
label = "",
396399
width = "280px",
@@ -399,7 +402,9 @@ observeEvent(input$selected_language, {
399402
setNames(c('nobonus'), i18n$t("No Bonus (2023Α)")),
400403
setNames(c('propbonus'), i18n$t("Proportional Bonus (2023Β-"))
401404
),
402-
selected = default_selected())
405+
selected = default_selected()),
406+
407+
readonly = "", .cssSelector = "input")
403408
})
404409
})
405410

0 commit comments

Comments
 (0)