Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions R/update-input.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ updateTextInput <- function(session = getDefaultReactiveDomain(), inputId, label
validate_session_object(session)

message <- dropNulls(list(
label = processDeps(label, session),
value = value,
label = if (!is.null(label)) processDeps(label, session),
value = value,
placeholder = placeholder
))
session$sendInputMessage(inputId, message)
Expand Down Expand Up @@ -116,7 +116,7 @@ updateCheckboxInput <- function(session = getDefaultReactiveDomain(), inputId, l
validate_session_object(session)

message <- dropNulls(list(
label = processDeps(label, session),
label = if (!is.null(label)) processDeps(label, session),
value = value
))
session$sendInputMessage(inputId, message)
Expand Down Expand Up @@ -183,7 +183,7 @@ updateActionButton <- function(session = getDefaultReactiveDomain(), inputId, la

if (!is.null(icon)) icon <- as.character(validateIcon(icon))
message <- dropNulls(list(
label = processDeps(label, session),
label = if (!is.null(label)) processDeps(label, session),
icon = icon,
disabled = disabled
))
Expand All @@ -192,7 +192,12 @@ updateActionButton <- function(session = getDefaultReactiveDomain(), inputId, la
#' @rdname updateActionButton
#' @export
updateActionLink <- function(session = getDefaultReactiveDomain(), inputId, label = NULL, icon = NULL) {
updateActionButton(session, inputId = inputId, label = processDeps(label, session), icon = icon)
updateActionButton(
session,
inputId = inputId,
label = label,
icon = icon
)
}


Expand Down Expand Up @@ -237,7 +242,7 @@ updateDateInput <- function(session = getDefaultReactiveDomain(), inputId, label
max <- dateYMD(max, "max")

message <- dropNulls(list(
label = processDeps(label, session),
label = if (!is.null(label)) processDeps(label, session),
value = value,
min = min,
max = max
Expand Down Expand Up @@ -291,7 +296,7 @@ updateDateRangeInput <- function(session = getDefaultReactiveDomain(), inputId,
max <- dateYMD(max, "max")

message <- dropNulls(list(
label = processDeps(label, session),
label = if (!is.null(label)) processDeps(label, session),
value = dropNulls(list(start = start, end = end)),
min = min,
max = max
Expand Down Expand Up @@ -395,7 +400,7 @@ updateNumericInput <- function(session = getDefaultReactiveDomain(), inputId, la
validate_session_object(session)

message <- dropNulls(list(
label = processDeps(label, session),
label = if (!is.null(label)) processDeps(label, session),
value = formatNoSci(value),
min = formatNoSci(min),
max = formatNoSci(max),
Expand Down Expand Up @@ -479,7 +484,7 @@ updateSliderInput <- function(session = getDefaultReactiveDomain(), inputId, lab
}

message <- dropNulls(list(
label = processDeps(label, session),
label = if (!is.null(label)) processDeps(label, session),
value = formatNoSci(value),
min = formatNoSci(min),
max = formatNoSci(max),
Expand Down Expand Up @@ -511,8 +516,8 @@ updateInputOptions <- function(session, inputId, label = NULL, choices = NULL,
}

message <- dropNulls(list(
label = processDeps(label, session),
options = options,
label = if (!is.null(label)) processDeps(label, session),
options = options,
value = selected
))

Expand Down Expand Up @@ -668,8 +673,8 @@ updateSelectInput <- function(session = getDefaultReactiveDomain(), inputId, lab
if (!is.null(selected)) selected <- as.character(selected)
options <- if (!is.null(choices)) selectOptions(choices, selected, inputId, FALSE)
message <- dropNulls(list(
label = processDeps(label, session),
options = options,
label = if (!is.null(label)) processDeps(label, session),
options = options,
value = selected
))
session$sendInputMessage(inputId, message)
Expand Down
Loading