Docs: clarify selectInput() NULL handling with multiple = TRUE#4390
Open
samuelbharti wants to merge 1 commit into
Open
Docs: clarify selectInput() NULL handling with multiple = TRUE#4390samuelbharti wants to merge 1 commit into
selectInput() NULL handling with multiple = TRUE#4390samuelbharti wants to merge 1 commit into
Conversation
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 rstudio#3844 Co-authored-by: Alex Bajcz <15620636+BajczA475@users.noreply.github.com> Co-authored-by: Garrick Aden-Buie <garrick@adenbuie.com>
Contributor
Author
|
Note for reviewers: the |
|
Rats, sorry, I forgot to finish up my work on this! Thanks to whomever finished it. Q1 26 was a hectic time for me :). Cheers to all of Shiny's maintainers! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3844
Summary
Extends the
@noteblock inselectizeInput()andvarSelectizeInput()(which@rdnameintoselectInput.RdandvarSelectInput.Rd, respectively) to call out a behavior that has surprised users: whenmultiple = TRUE, deleting all selected options yields an input value ofNULL, andobserveEvent()/eventReactive()ignoreNULLby default — so the transition to "no selection" silently fails to trigger downstream reactives. The new note points users toignoreNULL = FALSEas the knob to use when that behavior is undesirable.This is a docs-only change. It follows the approach @gadenbuie outlined in #3844 and revives the work @BajczA475 started in the closed #3846, with corrected wording (
ignoreNULL = FALSE, since the default is alreadyTRUE).No
NEWS.mdentry was added — recent precedent in this repo (e.g. f55c26a, 4361f2c, 5b6c187) is that pure roxygen clarifications don't get a NEWS bullet; NEWS is reserved for observable behavior changes. Happy to add one if preferred.Verification
devtools::document()regeneratedman/selectInput.Rdandman/varSelectInput.Rdcleanly.?selectInputand?varSelectInput; the new paragraph appears under "Note" with working cross-references toobserveEvent()andeventReactive()(the latter resolves via the alias inobserveEvent.Rd).