@@ -800,13 +800,14 @@ selectInput <- function(inputId, label, choices, selected = NULL,
800
800
# return label and select tag
801
801
res <- div(
802
802
class = " form-group shiny-input-container" ,
803
+ style = if (! is.null(width )) paste0(" width: " , validateCssUnit(width )),
803
804
controlLabel(inputId , label ),
804
805
div(selectTag )
805
806
)
806
807
807
808
if (! selectize ) return (res )
808
809
809
- selectizeIt(inputId , res , NULL , width , nonempty = ! multiple && ! (" " %in% choices ))
810
+ selectizeIt(inputId , res , NULL , nonempty = ! multiple && ! (" " %in% choices ))
810
811
}
811
812
812
813
firstChoice <- function (choices ) {
@@ -865,11 +866,15 @@ needOptgroup <- function(choices) {
865
866
# ' \code{selectInput(..., selectize = FALSE)}.
866
867
# ' @export
867
868
selectizeInput <- function (inputId , ... , options = NULL , width = NULL ) {
868
- selectizeIt(inputId , selectInput(inputId , ... , selectize = FALSE ), options , width )
869
+ selectizeIt(
870
+ inputId ,
871
+ selectInput(inputId , ... , selectize = FALSE , width = width ),
872
+ options
873
+ )
869
874
}
870
875
871
876
# given a select input and its id, selectize it
872
- selectizeIt <- function (inputId , select , options , width = NULL , nonempty = FALSE ) {
877
+ selectizeIt <- function (inputId , select , options , nonempty = FALSE ) {
873
878
res <- checkAsIs(options )
874
879
875
880
selectizeDep <- htmlDependency(
@@ -890,7 +895,6 @@ selectizeIt <- function(inputId, select, options, width = NULL, nonempty = FALSE
890
895
type = ' application/json' ,
891
896
`data-for` = inputId , `data-nonempty` = if (nonempty ) ' ' ,
892
897
`data-eval` = if (length(res $ eval )) HTML(toJSON(res $ eval )),
893
- `data-width` = validateCssUnit(width ),
894
898
if (length(res $ options )) HTML(toJSON(res $ options )) else ' {}'
895
899
)
896
900
)
0 commit comments