Semantic-ui: Dropdown multiple selection preserve select order

Created on 14 Mar 2017  路  4Comments  路  Source: Semantic-Org/Semantic-UI

Hey there!

When you select multiple values, the order you pick them is completely ignored.

Is there a way to preserve the order I pick the options?

Fiddle here:
https://jsfiddle.net/cawcxtqc/

Usage Question

All 4 comments

Hi @brunotourinho,

Try to use the full HTML pattern with get values behaviour: https://jsfiddle.net/yfLxbjjx/3/

Hello @Banandrew, thanks for your quick answer!
Shouldn't this behavior work for both "select-option" and the full html template?

@brunotourinho

It works with pre-existing HTML, because pre-existing HTML uses a hidden input with a delimiter to store its values, for example, <input type="hidden" name="number" value="5,3,2">鈥攖he order is obvious here. But when you initialize a dropdown on a <select> element, it hides that <select> element, then uses it to manipulate values instead of a hidden input in full pattern鈥檚 case.

If you look at the <select multiple>, how it looks in browsers by default鈥攍et鈥檚 take a look at the first example I could find in Google鈥攖here鈥檚 no way to figure out the order of selected options, all we can know, is that they are selected.

Therefore, it shouldn鈥檛 work for both, because it can鈥檛, and there鈥檚 no point in making the <select> element behave the same way, because the full pattern with a hidden input already exists to solve this problem.

@Banandrew thank you for the explanation!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

playgithub picture playgithub  路  3Comments

kntmrkm picture kntmrkm  路  3Comments

vinhtq picture vinhtq  路  3Comments

miguelmota picture miguelmota  路  3Comments

zhaoyao91 picture zhaoyao91  路  3Comments