1
0
mirror of synced 2024-11-25 22:36:03 +03:00
Commit Graph

825 Commits

Author SHA1 Message Date
Kevin Brown
a7e8f2bfad Fixed undefined opts when using select2('data')
This issue only affected single selects and should have happened when
calling `select2('data')` when passing in the new data object to select.

This closes https://github.com/select2/select2/issues/3694
2015-08-29 16:03:27 -04:00
Tom Zellman
3be19d8e62 Fix broken tags, #3695
The local variable defined will overwrite the tags function, since the var will get hoisted to the functional scope
2015-08-25 21:33:04 -04:00
Todd
61316a1351 !- maybe means != ?
Definitely a syntax error perhaps != was the intention?
2015-08-19 15:04:14 -04:00
Kevin Brown
2caa45ba98 Added debug option for migration notices
The `debug` option was chosen because the option also exists in
Select2 4.0.0 and provides similar warnings when configurations
are detected that are known to cause issues in Select2.

Warnings will be displayed in the console if the debug option is
enabled. As there are a lot of options that have been renamed in
Select2 4.0.0, using the older version of the options will trigger
a warning in Select2 3.5.3. Options which were also removed and
have clear migration paths will also trigger a warning with the
link to the relevant documentation.

Options which have been renamed in Select2 4.0.0 are now supported
in Select2 3.5.3, allowing people to migrate their installations
over to the new options before making the final switch.

This closes https://github.com/select2/select2/issues/3483.
2015-06-28 20:43:08 -04:00
Daniel Vinntreus
95e6f80619 Avoid error on empty search result in MultiSelect
This fixes https://github.com/select2/select2/issues/2942.
2015-06-28 18:14:17 -04:00
Coleman Watts
1afc8d9f27 Ensure focus event is unbound after widget is destroyed 2015-03-23 17:54:40 -04:00
Kevin Brown
3a10bd997a Merge pull request #2846 from colemanw/patch-2
Fix bug where elements in select2 drop cannot be focused
2015-01-23 20:14:09 -05:00
gkostov
19c0d3c0b5 Properly off() the events in the "select2" namespace
the dot, denoting a namespace and not an event name, was missing
2015-01-15 14:23:34 +02:00
Jeremy Leakakos and Jimmy Chao
db1d18fc5d Fix accessible aria activedescendant attribute
Remove aria-activedescendant attribute after the dropdown is closed,
to make sure the aria properties is vaild for aduit-tool
[https://code.google.com/p/accessibility-developer-tools/wiki/AuditRules#AX_ARIA_04:_ARIA_state_and_property_values_must_be_valid]
2014-12-17 15:23:54 -05:00
Leo Unglaub
09d3e94ada Fixing issue #2864
If you call element.attr ('style') with Zepto and
there is NO inline style, you get back the
CSS2Properties object. In jQuery you would get
nothing.

To avoid calling split in an object instead of a
string we should check if we really have a string.

Signed-off-by: Leo Unglaub <leo@leo-unglaub.net>
2014-12-16 18:36:03 +01:00
Kevin Brown
8651dac4af Merge pull request #2848 from tedliang/master
Fix performance issue with setVal on MultiSelect
2014-12-11 14:56:27 -05:00
Ted Liang
5c9e81053e fix buildChangeDetails for MultiSelect 2014-12-10 14:02:30 +11:00
Ted Liang
2ee7fadfce improves selectAll performance in MultiSelect2 2014-12-09 16:15:51 +11:00
colemanw
a732063f1b Fix bug where elements in select2 drop cannot be focused
This chrome workaround had the undesired side-effect of preventing anything in the select2 drop from being focused (affected single but not multi selects for some reason). Making the condition more specific to the actual problem being worked around solves this.
2014-12-05 17:05:59 -05:00
Jonathan Toms
3acc0c4e58 don't display a hidden input on destroy 2014-12-01 22:45:34 -05:00
Ludovic Montel
285abff24d Hide search box if select is empty
Fix #2282.
When a select box is empty (this appends in my case, I have a dynamic select box), the search box should not be shown.
2014-11-25 16:48:03 +01:00
Kevin Brown
f382f3d02d Merge pull request #2755 from kupishkis/2753
After clearSearch nextSearchTerm is not cleared
2014-11-21 08:47:35 -05:00
Jonathan Toms
a83ae7858a recalculate $dropdown height after drop-above class added 2014-11-05 00:10:15 -05:00
Kevin Brown
db7cd1b373 Go back to hiding the original element
This was only done to maintain compatibility with labels, back
when we could capture the focus events from the original element.
Now that we handle them in a different way, this is no longer
needed.

This fixes #2769.
2014-11-01 14:39:06 -04:00
Kevin Brown
1de4be3749 Fixed TypeError when destroying Select2
This fixes #2587.
2014-10-31 18:15:32 -04:00
Kevin Brown
7581fa5708 Merge pull request #2588 from fabdouglas/patch-8
Redirect the focus of original input to Select2
2014-10-31 18:13:47 -04:00
Kevin Brown
dd323687f3 Merge pull request #2364 from joshuajonah/master
Stopped refresh to top when `closeOnSelect: false`
2014-10-24 18:27:25 -04:00
Valdas Petrulis
c1f338cfbf Dont update the results if the term hasn't changed.
https://github.com/ivaynberg/select2/issues/2751
2014-10-23 10:04:39 +03:00
Valdas Petrulis
0cc0ac43f5 Fixed not to break use case: setting the new value after someone was just searching with a different value
https://github.com/ivaynberg/select2/issues/2751
2014-10-22 16:34:28 +03:00
Valdas Petrulis
03a15e070b After clearSearch nextSearchTerm is not cleared
https://github.com/ivaynberg/select2/issues/2753
2014-10-21 12:42:28 +03:00
Kevin Brown
5a184921b6 Merge pull request #2726 from KayLeung/patch-1
Fixes results count in accessible text
2014-10-16 17:41:22 -04:00
Arthur
35f706afbd fixing minor errors e.g. redefined variable 2014-10-16 14:27:19 +03:00
Kevin Brown
ea266346be Merge pull request #2665 from bor0/master
Items with spaces can be added infinite times on multiselects
2014-10-13 20:39:17 -04:00
Dementiy Kalkov
e716ad01e1 'document.body' instead of 'body' selector 2014-10-10 13:32:58 +04:00
Kay.L
b7a7dd064e Fixes results count in accessible text
Only counts the selectable items in the list. (filter out selected item)
2014-10-09 13:36:00 +08:00
Kevin Brown
c1df0aa942 Merge pull request #2702 from dgroux/master
allow formatSelection to return a jQuery object
2014-10-08 21:12:01 -04:00
Boro Sitnikovski
8644ccb68b Items with spaces can be added infinite times on multiselects
Add optional parameter transformVal that allows the user to define transformation for splitVal

Example demos:
(Infinite spaces, default transformVal):
http://jsfiddle.net/DV23t/9/

(No infinite spaces, transformVal = function (x) { return x; }):
http://jsfiddle.net/DV23t/12/
2014-10-08 23:28:41 +02:00
Vitor Oliveira
4955be239d Testing if the object exists before use it
It's necessary to make the code compatible with IE8 and IE9.
2014-10-07 13:07:58 -03:00
Dylan Roux
d385dc512e allow formatSelection to return a jQuery object 2014-09-26 15:14:19 +02:00
Kevin Brown
c5c42eaf72 Merge pull request #2695 from junhanamaki/master
allow markups of subsequent formatLoadMore message
2014-09-25 16:45:59 -04:00
junhanamaki
68070d0cac allow markups of subsequent formatLoadMore message
- setting message with html instead of text
- invoking escapeMarkup method before setting message
2014-09-23 20:48:18 +01:00
romille
633d4e6b4b fixes cutoff for bottom option when selecting with keyboard 2014-09-11 17:45:59 -04:00
Oshane Bailey
9207f23073 Fixed JS breakage due to undefined variable, viewPortLeft. 2014-08-26 22:24:33 -05:00
Kevin Brown
93157214ad Merge pull request #2415 from santialbo/text-function
Add text function for formatResult and formatSelection
2014-08-22 18:37:07 -04:00
Kevin Brown
7505bb6d60 Merge pull request #2595 from scotam/drop-left-check
Adds check for enough room before switching right to left drop
2014-08-22 18:23:18 -04:00
Kevin Brown
2e5538318e Merge pull request #2610 from torke1/patch-1
Prevent multiple select2-hidden-accessible span's
2014-08-21 18:58:17 -04:00
Kevin Brown
4645183054 Merge pull request #2227 from fabdouglas/patch-6
Ignore focus and error on IE7 for disabled select2
2014-08-17 16:49:25 -04:00
Mickael Perraud
afdb0da5f3 Syntax error with IE embedded as ActiveX in fat client
Syntax error with IE embedded as ActiveX in fat client
2014-08-14 13:59:09 +02:00
torke1
651047d52a Issue #2412
Maybe the fix is a bit ugly, but what it does is to make sure that we don't already have a select2-hidden-accessible span before we create a new one. Tested in several scenarios in our application and has solved the issue for us.
2014-08-13 17:27:07 +02:00
Rhodri Pugh
d2c9b9aac3 only switch right to left drop when enough room available 2014-08-07 11:48:55 +01:00
Fabrice Daugan
9d19b7f701 Redirect the focus of original input to Select2
Redirect the focus of original input to the "focus" event of Select2.
this way, we get back the accessible label for feature of previous Select2 versions.
2014-08-04 22:50:22 +02:00
Phazeshift
39382fab08 Fixing 'Type mismatch' exception in destroy in IE11 2014-08-01 12:19:19 +01:00
Jonas Pyfferoen
837715f939 Fixes #2278
Instead of instantly applying the translations, add them to an array.
That way users can include the language files that their site supports
and apply the required language using $.extend($.fn.select2.defaults,
$.fn.select2.locales["nl"]);

Signed-off-by: Kevin Brown <kevin@kevinbrown.in>
2014-07-01 19:17:20 -04:00
Kevin Brown
79b5bf6db9 Merge pull request #2483 from hitosu/master
filter 229 keyCodes (input method editor is processing key input)
2014-06-26 20:18:09 -04:00
Ermish
b505601629 Added Ajax Error Handling
Added an error message when an ajax error occurs. This can be
overridden through the select2 option “formatAjaxError”.
2014-06-25 19:40:08 -04:00