Skip to content

Commit fc234f4

Browse files
committed
Docs: clarify varSelectInput() purpose and fix typo
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 5865a28 commit fc234f4

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
@@ -36,6 +36,10 @@
3636

3737
* `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)
3838

39+
* Clarified `varSelectInput()` documentation to explain that the input
40+
returns a symbol for use with tidy evaluation, and fixed a grammatical
41+
typo. (#2334)
42+
3943
# shiny 1.13.0
4044

4145
## New features

R/input-select.R

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

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)