fix: adjusted to not allow typing

This commit is contained in:
Andreas Gammelgaard Damsbo 2026-03-30 20:16:33 +02:00
commit ce0ecef633
No known key found for this signature in database
2 changed files with 31 additions and 19 deletions

View file

@ -270,7 +270,7 @@ vectorSelectInput <- function(inputId,
colorSelectInput <- function(inputId,
label,
choices,
selected = "",
selected = NULL,
previews = 4,
...,
placeholder = "") {
@ -306,6 +306,10 @@ colorSelectInput <- function(inputId,
choices_new <- stats::setNames(vals, labels)
if (is.null(selected) || selected == "") {
selected <- vals[[1]]
}
shiny::selectizeInput(
inputId = inputId,
label = label,
@ -330,6 +334,14 @@ colorSelectInput <- function(inputId,
item.data.swatch +
'</div>';
}
}"
),
onInitialize = I(
"function() {
var self = this;
self.$control_input.prop('readonly', true);
self.$control_input.css('cursor', 'default');
self.$control.css('cursor', 'pointer');
}"
)
)

View file

@ -9,7 +9,7 @@ colorSelectInput(
inputId,
label,
choices,
selected = "",
selected = NULL,
previews = 4,
...,
placeholder = ""