1
0
mirror of synced 2024-11-23 05:26:10 +03:00
Commit Graph

15 Commits

Author SHA1 Message Date
alexweissman
62c4f6332b Merge branch 'master' of https://github.com/NadeemAfana/select2 into develop 2017-10-26 14:03:02 -04:00
alexweissman
58d9836b7d minor formatting fixes for #5093 2017-10-25 16:55:40 -04:00
Julian Yuste
b11d6e20b0 Fix for issue #4632 2017-10-25 18:25:50 +02:00
Nadim Afana
6e9657105b Fixed indentation. 2016-05-06 12:23:58 -07:00
Nadim Afana
a1dc7f23d1 Fixed unit tests and updated source code to handle HTML5 attribs. 2016-05-05 21:41:20 -07:00
Kevin Brown
d1ed0a513a Add failing test for existing array selections
This adds a broken test that demonstrates the issue seen in
https://github.com/select2/select2/issues/3990 where existing selected
options are being reset once Select2 is initialized. This issue cannot
be reproduced on the options page [1] because the issue only appear to
happen if the selected option is not the first one in the list of
possible options.

[1]: https://select2.github.io/examples.html#data-array
2016-01-03 18:21:09 -05:00
Phil Eberhardt
af212fa530 added test for #3564 fix 2015-07-11 22:11:55 -04:00
Kevin Brown
4fb079b34f Combine tests into a single file
This combines all of the tests into a single HTML file. This reduces
the number of Sauce Labs sessions and should improve test times.
2015-03-11 18:51:55 -04:00
Kevin Brown
7f17291932 Fix support for deep nesting
While deep nesting will not work on a standard `<select>`, we can
emulate it through data objects still, and just handle the display
of the data in the results.

This also means that the horrific deep-nested CSS is back to handle
the padding. I hope that will get fixed over time.

This also fixes one of the performance issues with adding array
data, as options are added at the very end instead of one by one.
2015-01-09 20:50:06 -05:00
Kevin Brown
8158e151ff Added test to make sure the options are generated 2014-11-06 12:12:43 -05:00
Kevin Brown
8ea23610f1 Convert array data to options immediately
This converts individual objects passed in through the `array`
parameter to `<option>` tags when Select2 is initialized. This
removes a lot of duplicate code from the `ArrayAdapter`, and keeps
everything closer to the native `<select>` element.

This introduces a breaking change from previous versions of Select2,
where the initial value for array data was blank, even if a blank
option was not present in the original array of objects. Now the
first object passed in will be selected by default, following the
behavior of a standard `<select>` element.

This breaking change does not affect `<select multiple="multiple">`
elements, which by default have no selection.
2014-11-06 12:05:12 -05:00
Kevin Brown
9e130956fc Better compatibility with array data
When using array data, and an option is selected, the data that is
attached to the DOM element will be run through `item` and should
have any private, automatically generated attributes added and
merged with it.
2014-10-21 21:44:00 -04:00
Kevin Brown
e018a6f69e Changed tests to not use deepEqual
We should only be checking the option values that matter, such as
`id` and `text`, instead of checking all of the option values. This
will prevent unexpected breaking when new properties are added to
the options.

Existing properties should be covered by tests to avoid regressions.
2014-10-21 21:44:00 -04:00
Kevin Brown
27ac50a854 Fixed problems with non-string ids
We have to enforce ids being strings as the values of options within
a select will always be an id.  This fixes an issue that we had with
array selections not being highlighted in the results.
2014-10-21 21:43:59 -04:00
Kevin Brown
cbfe23eb52 Added basic tests for select2/data/array 2014-10-21 21:43:58 -04:00