Select2 multiselect sort problem


In Select2 multi-select component how can I prevent sort alphabetically.

For Example.First I select Augrabies then Auckland.
But it shows me Auckland first and then Augrabies

How can I override this behavior ?

Thank you.

Not sure if I understand your question. Isn’t Auckland displays first then Augrabies so your current display is correct.

No not correct.

if I select “B” and then “A”, the multi select should display “B”, “A” and not “A”, “B”

can you show me any code on this? or your site link

go for “Select2 multi select”

select2 jquery works like that. In your dropdown example.

  1. Alaska
  2. Hawaii

then you select Hawaii so it will display 2nd because in the dropdown list it is 2nd and then if you select Alaska it displays 1st.

Yes I know that but what if I want to override that behavior.

try reading these links

just try, it might help you. Though I never tried it :slight_smile: