shiny::selectInput(..., choices = "")

I have a shiny app and am letting the server function populate the choices for one of my select inputs dynamically.

I noticed that having "" present in the 'choices' arg influences the 'nonempty' argument to shiny:::selectizeIt.

On the other hand, choices can also be NULL, list(), or character(). The end result in those cases is we get a data-nonempty="" tag in the output of shiny::selectInput whereas in the case of "" there is no such tag.

I am wondering what is special about "", and what difference this could make on the server side, particularly during input initialization. Basically I'm wondering what is the "best practice" for this kind of dynamically initialized input.


This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.