dropdownParent
option (#5622)language
option now has a clearly defined fallback chain (#5602)maximumSelectionLength
being ignored by closeOnSelect
(#5581)allowClear
no longer shifts selections to a new line (#5603)<option>
(#5560)computedstyle
option for calculating the width (#5559).select2-selection__placeholder
CSS definitions for multiple selects (#5508)clear
and clearing
events (#5058)scrollAfterSelect
option (#5150);
before beginning of factory wrapper (#5089)select2-selection__rendered
when selection is cleared (#4640, #4746)Defaults.set()
(#4364)Utils.__cache
instead of using $.data
(#4346, #5486)selection:update
(#4306).select2-hidden-accessible
(#4908)tk
) (#5125)sq
) (#5199)ka
) (#5179)ne
) (#5295)bn
) (#5248)removeAllItems
translation for clear “x” title (#5291)autocapitalize=off
with autocapitalize=none
(#4994)ps
) (#4960)dsb
and hsb
) (#4949)inputTooShort
message (#4817, 4896)af
) (#4850)bs
) (#4504)0
option values [16b4840c0e/, 0358ee5287/]<select>
serialization example [https://github.com/select2/select2/pull/4538]errorLoading
Hungarian translation [7d1d133523/]errorLoading
German translation [4df965219e/]errorLoading
Galician translation [8fcc6202c3/]errorLoading
Thai translation [625fc78ee6/]searching
and errorLoading
Finnish translations [https://github.com/select2/select2/pull/4730]errorLoading
Turkish translation [fd4a082531/, 751b36767f/]This is the third bugfix release of Select2 4.0.0. It builds upon the second bugfix release and fixes many common issues.
dropdownAutoWidth
option now properly works [fe26b083eb/]focus
event on the original <select>
is now handled [31e7a1d4c5/]select2('option')
no longer mutate the arguments when working on multiple elements [c2c1aeef31/]selectOnClose
now works properly with closeOnSelect
[481c43883e/]ajax.delay
to empty search terms as well [4b9e02f022/]<label>
[3bc7f4ac78/]ajax.url
[5a831afb9a/]errorLoading
[https://github.com/select2/select2/pull/4259]errorLoading
[b1ea28bb7d/]This is the second bugfix release of Select2 4.0.0. It builds upon the first release candidate of Select2 4.0.2 with some minor improvements.
insertTag
option to control the placement of the tags
option [https://github.com/select2/select2/pull/4008]id
and text
[https://github.com/select2/select2/issues/4086]change
just for Select2 [https://github.com/select2/select2/issues/3620]This is the first bugfix release of Select2 4.0.0. It builds upon the first release candidate of Select2 4.0.1 with some minor improvements.
templateResult
[dc516e7073/]templateSelection
[https://github.com/select2/select2/pull/3324]selectOnClose
and now be used with closeOnSelect
without getting a stack overflow [393ca4cf7f/]:all:
is now correctly removed when used in containerCss
and dropdownCss
options [https://github.com/select2/select2/pull/3464]change
event was triggered [698fe7b9e1/, 88503d2c67/, dd2990adea/]ArrayAdapter
where the existing <option>
data would be used instead of the array data [https://github.com/select2/select2/pull/3565]$dropdownContainer.width()
in the AttachBody
decorator [https://github.com/select2/select2/pull/3654]AttachBody
decorator [671f5a2ce2/]open
event trigger [https://github.com/select2/select2/pull/3507]this
in ajax.data
and ajax.url
callback functions [https://github.com/select2/select2/issues/3361]<select>
not always being hidden correctly in some cases [https://github.com/select2/select2/pull/3301]maxiumSelectionLength
example [https://github.com/select2/select2/pull/3454]Option
parameters in the 4.0 announcement [https://github.com/select2/select2/pull/3547]inputTooLong
and inputTooShort
messages in the Galician translation [https://github.com/select2/select2/pull/3291]errorLoading
for Indonesian translation [https://github.com/select2/select2/pull/3635]errorLoading
for Danish translation [https://github.com/select2/select2/pull/3870]This builds upon the second release candidate, so review all previous release notes before upgrading from previous versions of Select2.
jQuery.noConflict
.<select>
is the recommended element and can be used for all options. There is limited backwards-compatible support for the <input>
element in full builds.data-*
attributesen-US
) and Select2 will be able to determine what translation files to load.bower.json
/component.json
files.<select>
has replaced <input type="hidden" />
for all options (including remote data)matcher
has been revamped to include full context, a compatibility module (select2/compat/matcher
) has been createdselectionAdapter
with the ClickMask
(select2/selection/clickMask
) decorator.StopPropagation
modules available in the full builds to prevent this. [8f8140e3b0/]width
option has been changed from style
to resolve
.copy
value for the width
option has been renamed to style
.formatSelection
-> templateSelection
formatResult
-> templateResult
sortResults
-> sorter
createSearchChoice
-> createTag
selectOnBlur
-> selectOnClose
ajax.jsonpCallback
-> ajax.jsonp
ajax.results
-> ajax.processResults
tags: [array,of,data]
-> data: [array,of,data], tags: true
placeholderOption
has been replaced by placeholder.id
(placeholder
-> placeholder.text
)formatNoMatches
-> language.noMatches
formatSearching
-> language.searching
formatInputTooShort
-> language.inputTooShort
formatInputTooLong
-> language.inputTooLong
formatAjaxError
-> language.errorLoading
formatLoading
-> language.loadingMore
formatSelectionTooBig
-> language.maximumSelected
initSelection
- This is no longer needed with <select>
tags. Limited backwards compatibility in the full build.id
- Data objects should now always have id
and text
attributes that are strings, use $.map
when migratingquery
- Use a custom data adapter instead. Limited backwards compatibility in the full build.ajax.params
- All parameters passed to ajax
will be passed to the AJAX data transport function.select2("val", [value])
-> .val([value])
.select2("enable", !disabled)
-> .prop("disabled", disabled)
.select2("onSortStart")
and .select2("onSortEnd")
- A custom selection adapter should be created instead.select2("data", data)
- Create the <option>
tags for the objects that you would like to set, and set the .val
to select them.select2("readonly")
- There is no way to make a <select>
element read-only, disable it insteadselect2:closing
is triggered before the dropdown is closedselect2:select
is triggered when an option is selectedselect2-close
is now select2:close
select2-open
is now select2:open
select2-opening
is now select2:opening
select2-selecting
is now select2:selecting
select2-removed
is now select2:unselect
select2-removing
is now select2:unselecting
select2-clearing
has been removed in favor of select2:unselecting
select2-highlight
select2-loaded
select2-focus
- Use the native focus
event insteadselect2-blur
- Use the native blur
event insteadchange
event were removed
val
can be retrieved with $element.val()
insteadadded
can be retrieved by listening to select2:select
removed
can be retrieved by listening to select2:unselect