web-components icon indicating copy to clipboard operation
web-components copied to clipboard

Support drag drop of selected items in multi-select combo box

Open veenatic82 opened this issue 1 year ago • 5 comments

Describe your motivation

I want to allow the user to reorder the selected items. For example, user has selected some items from the drop-down and combo-box shows them in the order of selection.

Describe the solution you'd like

the user should be able to drag drop the selected items in the box at the desired position (one at a time) to rearrange the order of selected items. this is especially useful when you set the combo-box property autoExpand and selectedItemsOnTop in v24.6

Describe alternatives you've considered

Alternative is to use grid and use its drag drop feature. but the current way it allows for drag drop is not serving my purpose. For example, when multiple items are selected in the grid using its selection feature. and when user starts to drag, it drags all the selected items and its not very intuitive. i would have wanted an option to allow dragging of just one item.

But I think in the combo-box, its much more intuitive if there was such option

Additional context

No response

veenatic82 avatar Dec 27 '24 14:12 veenatic82

^push. MSCB is our only form-based multi select component. It would be awesome to allow sorting to create some kind of priority selection. Grid is way too huge for it.

knoobie avatar Sep 26 '25 12:09 knoobie

Do you have any API naming suggestions? We have dragSelect in grid, so maybe something like dragReorder would work.

web-padawan avatar Sep 26 '25 13:09 web-padawan

My first suggestion would be setChipsDragable(true) or setChipsReorder(ing)(true). The chips might be really easy to make in a good way sortable by either using the mouse or shift+left/right to move them

knoobie avatar Sep 26 '25 13:09 knoobie

Just to clarify, would you like to reorder chips (not dropdown items), regardless of whether the overlay is opened or not? If so, chipsDraggable would indeed be reasonable. It should be also easier to implement than dragging scroller items.

web-padawan avatar Sep 26 '25 13:09 web-padawan

Our use-case would be solved by allowing the chips to be sortable when the dropdown is closed / once people start interacting with a chip the dropdown can be closed.

While it might also be desirable to move the items in the dropdown, it feels more naturally to move the chips afterwards.

knoobie avatar Sep 26 '25 16:09 knoobie