Skip to content

Commit 8ea5d62

Browse files
samuelbhartiBajczA475gadenbuie
authored
Docs: clarify selectInput() NULL handling with multiple = TRUE (#4390)
Extend the @note in `selectizeInput()` and `varSelectizeInput()` to explain that deleting all selections with `multiple = TRUE` yields `NULL`, and that `observeEvent()` / `eventReactive()` ignore `NULL` by default — point users to `ignoreNULL = FALSE`. Fixes #3844 Co-authored-by: Alex Bajcz <15620636+BajczA475@users.noreply.github.com> Co-authored-by: Garrick Aden-Buie <garrick@adenbuie.com>
1 parent cceb4e4 commit 8ea5d62

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

R/input-select.R

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,11 @@ needOptgroup <- function(choices) {
187187
#' value when it is a single choice input and the empty string is not in the
188188
#' `choices` argument. This is to keep compatibility with
189189
#' `selectInput(..., selectize = FALSE)`.
190+
#'
191+
#' When `multiple = TRUE`, deleting all selected options yields an input
192+
#' value of `NULL`. Because [observeEvent()] and [eventReactive()] ignore
193+
#' `NULL` by default, this transition will not trigger them unless you set
194+
#' `ignoreNULL = FALSE`.
190195
#' @export
191196
selectizeInput <- function(inputId, ..., options = NULL, width = NULL) {
192197
selectizeIt(
@@ -411,6 +416,11 @@ varSelectInput <- function(
411416
#' value when it is a single choice input and the empty string is not in the
412417
#' `choices` argument. This is to keep compatibility with
413418
#' `selectInput(..., selectize = FALSE)`.
419+
#'
420+
#' When `multiple = TRUE`, deleting all selected options yields an input
421+
#' value of `NULL`. Because [observeEvent()] and [eventReactive()] ignore
422+
#' `NULL` by default, this transition will not trigger them unless you set
423+
#' `ignoreNULL = FALSE`.
414424
#' @export
415425
varSelectizeInput <- function(inputId, ..., options = NULL, width = NULL) {
416426
selectizeIt(

man/selectInput.Rd

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/varSelectInput.Rd

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)