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
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.
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>
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.
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.
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/
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.
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.
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>