react-dual-listbox icon indicating copy to clipboard operation
react-dual-listbox copied to clipboard

How to move children on selecting parent item

Open chandandas opened this issue 6 years ago • 2 comments

Is there a way to move all child items after selecting the parent?

ex. if i select country then all states belong to that automatically move to right hand side?

chandandas avatar Nov 30 '18 11:11 chandandas

Good question. There is not a way to currently do this.

The parent items are based on <optgroup> elements in the select box and it appears that browsers generally do not allow you select a parent. It may be possible workaround this someway, but the logic could get a bit tricky because you can CTRL or SHIFT click items in a <select> box. I am open to a pull request that could add this in, but for the moment it seems a bit tricky to implement.

jakezatecky avatar Dec 07 '18 21:12 jakezatecky

Hi Jake! Thanks for creating this component.

I am also looking for such a functionality. So the only workaround is to select all the child items present? This might become burdensome when there are many child items. Is there any other more elegant solution for this which I can use in the meantime?

virajdesaiofficial avatar Apr 13 '21 07:04 virajdesaiofficial