Force no default selection in selectInput()

前端 未结 6 1164
别跟我提以往
别跟我提以往 2021-02-01 02:17

The Shiny documentation mentions that for selectInput():

selected The value (or, if none was supplied, the title) of the naviga

6条回答
  •  滥情空心
    2021-02-01 02:50

    You can use the selectize input instead of the select input, with some custom selectize options to set the initial selection to be empty. An example has been provided in the Shiny Gallery. In particular, see the example #6.

    # make sure you have shiny >= 0.9.1
    selectizeInput(
      'e6', '6. Placeholder', choices = state.name,
      options = list(
        placeholder = 'Please select an option below',
        onInitialize = I('function() { this.setValue(""); }')
      )
    )
    

    BTW, for the error "ERROR: bad 'file' argument", I do not think anybody can help you without seeing the source code of your app, and it may be a separate question.

提交回复
热议问题