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

Fix ensuring order of items in checkboxes and select options #445

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pkatseas
Copy link

I came across an issue where the options in select elements were ordered inconsistently across browsers.
It looks like jQuery's add() cannot guarantee the order of elements added, which we can ensure by using a document fragment.

@exussum12
Copy link
Collaborator

What browser is this an issue with ?

@pkatseas
Copy link
Author

I tested it on Chrome and Firefox. Chrome was displaying select options in a seemingly random order, albeit consistent. Firefox was always displaying the options in the order expected (as specified through comparator).

@exussum12
Copy link
Collaborator

The commit has conflicts, Can you just update the src files, the build process will run soon after merge (and prevent the merge conflicts)

@glenpike
Copy link
Collaborator

glenpike commented Jun 2, 2016

Would it not be better to push the items into an array, then return this - html() will take an array of elements (from jQuery 1.8 I believe) https://jsfiddle.net/glenpike/noc4Lxoo/

(It avoids chopping and changing between vanilla & jQuery based script)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants