Skip to content

Commit 7d50304

Browse files
authored
Docs: clarify varSelectInput() purpose and fix typo (#4391)
Explain that `varSelectInput()` is a `selectInput()` convenience wrapper that returns the selected column name as a symbol for use with tidy evaluation, and use plain `selectInput()` when a symbol is not needed. Also fix the "to instead of" -> "instead of" typo in the existing description of selectize.js. Fixes #2334
1 parent 8ea5d62 commit 7d50304

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@
4444

4545
* `need()` now gives a clearer error when called without either a `message` or `label` argument, instead of the cryptic "argument \"label\" is missing, with no default". (thanks @chasemc and @sundrelingam, #2509)
4646

47+
* Clarified `varSelectInput()` documentation to explain that the input
48+
returns a symbol for use with tidy evaluation, and fixed a grammatical
49+
typo. (#2334)
50+
4751
# shiny 1.13.0
4852

4953
## New features

R/input-select.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,15 @@ selectizeScripts <- function() {
304304
#' Create a select list that can be used to choose a single or multiple items
305305
#' from the column names of a data frame.
306306
#'
307+
#' `varSelectInput()` is a convenience wrapper around [selectInput()] for use
308+
#' with tidy evaluation: it returns the selected column name as a symbol
309+
#' (see "Server value" below) so the value can be spliced directly into
310+
#' tidy-evaluation contexts without wrapping it in [rlang::sym()]. If you
311+
#' don't need a symbol, use [selectInput()] instead.
312+
#'
307313
#' By default, `varSelectInput()` and `selectizeInput()` use the
308314
#' JavaScript library \pkg{selectize.js}
309-
#' (<https://selectize.dev/>) to instead of the basic
315+
#' (<https://selectize.dev/>) instead of the basic
310316
#' select input element. To use the standard HTML select input element, use
311317
#' `selectInput()` with `selectize=FALSE`.
312318
#'

man/varSelectInput.Rd

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)