Skip to content

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