Skip to content

Commit

Permalink
isTRUE rather than an "is multiple" helper
Browse files Browse the repository at this point in the history
  • Loading branch information
aronatkins committed Sep 13, 2024
1 parent c01e1b8 commit 2d4724c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions R/params.R
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ params_get_input <- function(param) {
if (is.null(input)) {
if (!is.null(param$choices)) {
## select for a large number of choices and multiple choices.
if (params_allows_multiple(param)) {
if (isTRUE(param$multiple)) {
input <- "select"
} else if (length(param$choices) > 4) {
input <- "select"
Expand Down Expand Up @@ -213,10 +213,6 @@ params_get_control <- function(param) {
control
}

params_allows_multiple <- function(param) {
return(!is.null(param$multiple) && param$multiple)
}

# Returns true if the parameter can be configurable with Shiny UI elements.
params_configurable <- function(param) {
inputControlFn <- params_get_control(param)
Expand All @@ -225,7 +221,7 @@ params_configurable <- function(param) {
}
# Some inputs (like selectInput) support the selection of
# multiple entries through a "multiple" argument.
if (params_allows_multiple(param)) {
if (isTRUE(param$multiple)) {
return(TRUE)
}
# sliderInput supports either one or two-value inputs.
Expand Down

0 comments on commit 2d4724c

Please sign in to comment.