Skip to content

Docs: clarify selectInput() NULL handling with multiple = TRUE#4390

Open
samuelbharti wants to merge 1 commit into
rstudio:mainfrom
samuelbharti:samuelbharti/review-shiny-issue-3844
Open

Docs: clarify selectInput() NULL handling with multiple = TRUE#4390
samuelbharti wants to merge 1 commit into
rstudio:mainfrom
samuelbharti:samuelbharti/review-shiny-issue-3844

Conversation

@samuelbharti
Copy link
Copy Markdown
Contributor

Fixes #3844

Summary

Extends the @note block in selectizeInput() and varSelectizeInput() (which @rdname into selectInput.Rd and varSelectInput.Rd, respectively) to call out a behavior that has surprised users: when multiple = TRUE, deleting all selected options yields an input value of NULL, and observeEvent() / eventReactive() ignore NULL by default — so the transition to "no selection" silently fails to trigger downstream reactives. The new note points users to ignoreNULL = FALSE as 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 already TRUE).

No NEWS.md entry 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() regenerated man/selectInput.Rd and man/varSelectInput.Rd cleanly.
  • Render ?selectInput and ?varSelectInput; the new paragraph appears under "Note" with working cross-references to observeEvent() and eventReactive() (the latter resolves via the alias in observeEvent.Rd).
  • No code paths were touched, so no test changes were needed.

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>
@samuelbharti samuelbharti marked this pull request as ready for review May 28, 2026 19:34
@samuelbharti
Copy link
Copy Markdown
Contributor Author

Note for reviewers: the routine / routine check failed with an Invalid GitHub PAT format error inside devtools::document()'s reexport-tag-lookup step (gh::gh("GET /repos/.../tags")validate_gh_pat()). This is unrelated to the docs change in this PR — all R-CMD-check jobs and website / pkgdown passed cleanly. PR #4386 from this same fork passed the same check yesterday, so this looks like a flaky/transient PAT-validation issue in fork-PR runs. A rerun of the failed job should clear it.

@BajczA475
Copy link
Copy Markdown

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve selectInput() docs for NULL handling when multiple = TRUE and selected = NULL

2 participants