shinyWidgets icon indicating copy to clipboard operation
shinyWidgets copied to clipboard

pickerInput: preserve order of selections when multiple choices are allowed

Open daattali opened this issue 2 years ago • 2 comments

When using a picker input with multiple selections, sometimes preserving the order of the choices is important. For example, if I select "option 2" and then "option 1", I might actually care about getting the result as c("option 2", "option 1") instead of the default ordering that appears in the UI.

daattali avatar Mar 16 '23 16:03 daattali

I realize this might not be fixable from {shinyWidgets} and may depend on the underlying javascript library being used. I did find the corresponding issue https://github.com/snapappointments/bootstrap-select/issues/2119 - if anyone comes to pickerInput wanting this feature, please go to the issue linked in this comment and upvote.

daattali avatar Mar 16 '23 16:03 daattali

Yes, see https://github.com/dreamRs/shinyWidgets/issues/49, I don't think it'll be integrated in bootstrap-select soon, development is not very active. Note that this functionnality is available with virtualSelectInput().

pvictor avatar Mar 16 '23 16:03 pvictor