Select to view content in your preferred language

Dropdown Groups - get a single selection

925
2
Jump to solution
08-11-2023 12:15 PM
LefterisKoumis
Frequent Contributor

I have a group of  dropdown. Only one item can be selected from all groups.However, I cannot display a single selection since clicking on a different group it will display the selection for that group.

LefterisKoumis_0-1691781046297.png

So, to remove it, I have to use selection-mode= none. However, by doing so, I cannot get the selected innerText.

Is there a way to allow the display of only one selection from all groups? if not, how can I get the selecteditem if I use selection-mode="none"?

I also experiment with using selection-mode="single" and place it at the calcite-dropdown to cover both groups. However, it seems that after selecting few times, it records the selection from one group only.

Thank you.

Codepen 

@KittyHurley 

0 Kudos
1 Solution

Accepted Solutions
KittyHurley
Esri Contributor

@LefterisKoumis Dropdown doesn't support selection across groups, but a similar workflow could be achieved with the Dropdown Item's icon-start and/or icon-end attributes: https://codepen.io/geospatialem/pen/poQMKjY using icons to group items. 

Also, while not fulfilling the same design as Dropdown, for more complex workflows Combobox could be used with multiple groups and one selection: https://codepen.io/geospatialem/pen/xxQvWjz

View solution in original post

0 Kudos
2 Replies
KittyHurley
Esri Contributor

@LefterisKoumis Dropdown doesn't support selection across groups, but a similar workflow could be achieved with the Dropdown Item's icon-start and/or icon-end attributes: https://codepen.io/geospatialem/pen/poQMKjY using icons to group items. 

Also, while not fulfilling the same design as Dropdown, for more complex workflows Combobox could be used with multiple groups and one selection: https://codepen.io/geospatialem/pen/xxQvWjz

0 Kudos
LefterisKoumis
Frequent Contributor

Thank you. I will change my script to use combobox. Currently,  I don't see any advantages for using dropdown over combobox. 

0 Kudos