The Shiny documentation mentions that for selectInput()
:
selected
The value (or, if none was supplied, the title) of the naviga
Faced a similar issue. The solution I found is based of @MKa's answer. You do not want to set multiple=T if your code can't handle multiple values. What I suggest is:
selectInput("molecule",
"Select Molecule:",
choices = c("",as.character(mtrl_name)),
selected = NULL,
multiple = F
)
And to retrieve the value selected:
if(!is.null(input$molecule))
{
if(nchar(input$molecule)>1)
{
#do your thing..
}
}
Fixed my problem. Let me know if you found a better solution.