add width to selectInput() as well

This commit is contained in:
Yihui Xie
2014-05-19 11:23:52 -05:00
parent f8b38e4683
commit 5b6268f5bc

View File

@@ -696,7 +696,7 @@ choicesWithNames <- function(choices) {
#' "Gears" = "gear"))
#' @export
selectInput <- function(inputId, label, choices, selected = NULL,
multiple = FALSE, selectize = TRUE) {
multiple = FALSE, selectize = TRUE, width = NULL) {
# resolve names
choices <- choicesWithNames(choices)
@@ -723,7 +723,7 @@ selectInput <- function(inputId, label, choices, selected = NULL,
# return label and select tag
res <- tagList(controlLabel(inputId, label), selectTag)
if (!selectize) return(res)
selectizeIt(inputId, res, NULL, nonempty = !multiple && !("" %in% choices))
selectizeIt(inputId, res, NULL, width, nonempty = !multiple && !("" %in% choices))
}
#' @rdname selectInput