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 [https://github.com/select2/select2/commit/16b4840c0e2df0461998e3b464ee0a546173950d, https://github.com/select2/select2/commit/0358ee528765157234643d289bce6b8ca5889c72]<select> serialization example [https://github.com/select2/select2/pull/4538]errorLoading Hungarian translation [https://github.com/select2/select2/commit/7d1d13352321e21670ff1c6cba7413aa264fd57a]errorLoading German translation [https://github.com/select2/select2/commit/4df965219ea4c39147fde9335bc260840465933a]errorLoading Galician translation [https://github.com/select2/select2/commit/8fcc6202c37f4e06d951342bf142a3b906b6b8e3]errorLoading Thai translation [https://github.com/select2/select2/commit/625fc78ee616baedf64aa37357403b4b72c7363c]searching and errorLoading Finnish translations [https://github.com/select2/select2/pull/4730]errorLoading Turkish translation [https://github.com/select2/select2/commit/fd4a0825315c7055347726d5818c999279f96ff8, https://github.com/select2/select2/commit/751b36767f9f28b9de9428d5e8035c9a404915d9]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 [https://github.com/select2/select2/commit/fe26b083eb830836061de1458e483782cefef424]focus event on the original <select> is now handled [https://github.com/select2/select2/commit/31e7a1d4c52ed7477769fcad5d15166ae3c9b4d0]select2('option') no longer mutate the arguments when working on multiple elements [https://github.com/select2/select2/commit/c2c1aeef31c95c6df5545c900a4e1782d712497c]selectOnClose now works properly with closeOnSelect [https://github.com/select2/select2/commit/481c43883e23874e9c35879d173eb8cc5b994b12]ajax.delay to empty search terms as well [https://github.com/select2/select2/commit/4b9e02f02211248be25ac4c16d4635cf38237bb9]<label> [https://github.com/select2/select2/commit/3bc7f4ac78b58eff8cd17b3273596638c3c9c5c1]ajax.url [https://github.com/select2/select2/commit/5a831afb9a7d46e8f20aec21164cfbfd182024de]errorLoading [https://github.com/select2/select2/pull/4259]errorLoading [https://github.com/select2/select2/commit/b1ea28bb7d8c02b3b352f558031ccfc8041122eb]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 [https://github.com/select2/select2/commit/dc516e7073605723be59bc727b96a3b3dea1ae5a]templateSelection [https://github.com/select2/select2/pull/3324]selectOnClose and now be used with closeOnSelect without getting a stack overflow [https://github.com/select2/select2/commit/393ca4cf7f7f7097d3a994bda3dbf195e945eba1]:all: is now correctly removed when used in containerCss and dropdownCss options [https://github.com/select2/select2/pull/3464]change event was triggered [https://github.com/select2/select2/commit/698fe7b9e187e182f679aa679eb8b0ecb64a846b, https://github.com/select2/select2/commit/88503d2c67dc7f4fb9395a17f17edfe4948cf738, https://github.com/select2/select2/commit/dd2990adead92593a2dffff6ae004ea8b647d130]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 [https://github.com/select2/select2/commit/671f5a2ce21005090e0b69059799cd3dd1fbbf84]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. [https://github.com/select2/select2/commit/8f8140e3b00c5d5bb232455137c4c633d7da4275]width option has been changed from style to resolve.copy value for the width option has been renamed to style.formatSelection -> templateSelectionformatResult -> templateResultsortResults -> sortercreateSearchChoice -> createTagselectOnBlur -> selectOnCloseajax.jsonpCallback -> ajax.jsonpajax.results -> ajax.processResultstags: [array,of,data] -> data: [array,of,data], tags: trueplaceholderOption has been replaced by placeholder.id (placeholder -> placeholder.text)formatNoMatches -> language.noMatchesformatSearching -> language.searchingformatInputTooShort -> language.inputTooShortformatInputTooLong -> language.inputTooLongformatAjaxError -> language.errorLoadingformatLoading -> language.loadingMoreformatSelectionTooBig -> language.maximumSelectedinitSelection - 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:closeselect2-open is now select2:openselect2-opening is now select2:openingselect2-selecting is now select2:selectingselect2-removed is now select2:unselectselect2-removing is now select2:unselectingselect2-clearing has been removed in favor of select2:unselectingselect2-highlightselect2-loadedselect2-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:selectremoved can be retrieved by listening to select2:unselect