Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onChange returns alphabetically sorted values #11

Closed
rasmusgadensgaard opened this issue Sep 28, 2017 · 5 comments
Closed

onChange returns alphabetically sorted values #11

rasmusgadensgaard opened this issue Sep 28, 2017 · 5 comments

Comments

@rasmusgadensgaard
Copy link

The onChange method returns alphabetically sorted values. Shouldn't it return the values in the same order as displayed?

@brianvoe
Copy link
Owner

So after looking at this in more detail i didnt implement any type of alphabetical sorting. What essentially is happening is based upon how its selecting may append to the end of the list or set the value of the original select and rebuild the select value in the order of the select options.

@brianvoe
Copy link
Owner

In any case I didnt see a value to make any adjustments to this issue.

@rasmusgadensgaard
Copy link
Author

I get your point in that this is not related to alphabetically sorting, my bad.

The issue is that the onChange, and I guess also the other events returns the selected values in the original order of the tags, not in the order in which they where selected.

This results in an inconsistent application when you use slimselectjs to build a page dynamically based on the selections, because the slimselectjs dropdown will display selected options in the order in which they were selected, while the events will return the original order.

@brianvoe
Copy link
Owner

I see your point. Ok so what I'm going to do to keep consistency is derive the visual selection and the output of selected values based upon the original order of the list. This should help your situation.

I'll let you know when this is done.

@brianvoe
Copy link
Owner

brianvoe commented Oct 2, 2017

Ok v1.2.0. I updated the code make the multiselect value display in the same order as the original select. I also made sure the onchange values returning back are also in the order of the original select.

Thanks for submitting this issue!

@brianvoe brianvoe closed this as completed Oct 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants