ericrayanderson/shinymaterial

update_material_dropdown does not take vector as selected choices

Opened this issue · 1 comments

It accepts only one single value as in example

update_material_dropdown(
session,
input_id = "example_dropdown",
value = "New Text"
)

Even if there are many names in the list.
In contrary, updateSelectizeInput accepts vector:

updateSelectizeInput(session, inputId = "countries",selected=c("Mexico", "China", "Italy") )

Can it be fixed or am I wrong about it ?
Thanx

@alyoshkin I will PR a solution.

@ericrayanderson, I think in this case the option selectedis more clear than value; but it will create a breaking change.
What I can do is to add parameter selected and let the parameter value; the user will be notified that value is depreciated if he use it.
Then I will write the code with selected but overwrite selected by value if the value is not null.

What do you think of that ?

For the moment I will keep value in my PR.