select2

Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.

MIT License

Downloads
2.4M
Stars
25.9K
Committers
551

Bot releases are hidden (Show)

select2 - 4.0.1 Release Candidate 1

Published by kevin-brown almost 9 years ago

New features / Improvements

  • The option container is now passed in as the second argument when templating selections using templateSelection [https://github.com/select2/select2/pull/3324]
  • You can immediately start typing to search when tabbing into a multiple select [https://github.com/select2/select2/commit/02cca7baa7b78e73cdcf393172ee3a54be387167, https://github.com/select2/select2/commit/79cdcc0956e242c1ce642bbaa93e538c54f4be0]
  • All parameters passed in for AJAX requests are now set as query string parameters by default [https://github.com/select2/select2/issues/3548]

Bug fixes

  • Fixed bug where multiple selects with placeholders were buggy in IE [https://github.com/select2/select2/issues/3300]
  • Fixed bug where AJAX selects could not be initialized with array data [https://github.com/select2/select2/pull/3375]
  • :all: is now correctly removed when used in containerCss and dropdownCss options [https://github.com/select2/select2/pull/3464]
  • Fixed bug where the multiple select search box would appear on the left in RTL mode [https://github.com/select2/select2/pull/3502]
  • Change ALT + UP to close the dropdown instead of opening it [https://github.com/select2/select2/commit/d2346cc33186c2a00fa2dad29e8e559c42bfea00]
  • Fix focus issue with the multiple select search box when the 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]
  • Fix bug in ArrayAdapter where the existing <option> data would be used instead of the array data [https://github.com/select2/select2/pull/3565]
  • Remove random call to $dropdownContainer.width() in the AttachBody decorator [https://github.com/select2/select2/pull/3654]
  • Fix memory leak in AttachBody decorator [https://github.com/select2/select2/commit/671f5a2ce21005090e0b69059799cd3dd1fbbf84]
  • Selections can no longer be removed when Select2 is in a disabled state [https://github.com/select2/select2/commit/68d068f1d2c7722d011d285a291d1f974bf09772, https://github.com/select2/select2/commit/7d8f86cbf85ebd2179195ff6a2a7a1c5dcb9da58]
  • Remove redundant open event trigger [https://github.com/select2/select2/pull/3507]
  • Correct references to this in ajax.data and ajax.url callback functions [https://github.com/select2/select2/issues/3361]
  • Apply select2('option') calls on all elements [https://github.com/select2/select2/pull/3495]

Design

  • Fixed original <select> not always being hidden correctly in some cases [https://github.com/select2/select2/pull/3301]
  • Fix potential issue with Bootstrap's gradients in Internet Explorer [https://github.com/select2/select2/pull/3307]
  • Improve compatibility with Zurb Foundation [https://github.com/select2/select2/pull/3290]
  • Remove padding on mobile safari search field in multiple selects [https://github.com/select2/select2/pull/3605]
  • Fix the clear button appearing beneath long text [https://github.com/select2/select2/issues/3306]
  • Migrate the CSS classes for the "Loading more results" message to BEM [https://github.com/select2/select2/issues/3889]
  • Fix inline search not displaying properly in Safari [https://github.com/select2/select2/issues/3459]

Documentation

  • New documentation theme designed by @fk [https://github.com/select2/select2/pull/3376, https://github.com/select2/select2/pull/3467, https://github.com/select2/select2/pull/3488]
  • Update ajax example to reflect pagination [https://github.com/select2/select2/pull/3357]
  • Fix incorrect option name in maxiumSelectionLength example [https://github.com/select2/select2/pull/3454]
  • Fix typos in the disabled mode/results examples [https://github.com/select2/select2/pull/3665]
  • Fix Option parameters in the 4.0 announcement [https://github.com/select2/select2/pull/3547]
  • Fix invalid JSON in the tags example within the 4.0 announcement [https://github.com/select2/select2/pull/3637]

Translations

  • Swapped the inputTooLong and inputTooShort messages in the Galician translation [https://github.com/select2/select2/pull/3291]
  • Fix improper grammar in Dutch translation [https://github.com/select2/select2/pull/3692]
  • Add Japanese translation [https://github.com/select2/select2/pull/3477]
  • Polish translation: Fixed typo in maximum selected message [https://github.com/select2/select2/pull/3587]
  • Add Malay translation [https://github.com/select2/select2/pull/3635]
  • Add errorLoading for Indonesian translation [https://github.com/select2/select2/pull/3635]
  • Correct grammar issues in Hebrew translation [https://github.com/select2/select2/pull/3911]
  • Add errorLoading for Danish translation [https://github.com/select2/select2/pull/3870]
  • Add Arabic translation [https://github.com/select2/select2/pull/3859]
select2 - Select2 3.5.4

Published by kevin-brown about 9 years ago

This bug fix release comes 11 days after the release of Select2 3.5.3, so it is recommended to also check out that release when upgrading.

Bug fixes

  • Tagging is back and working [https://github.com/select2/select2/issues/3695]
  • Fixed setting data using select2('data') on a single select breaking [https://github.com/select2/select2/issues/3694]

Select2 3.5.3 release notes

New features

This release does not add any new features, but it does add migration assistance for those who are looking to upgrade to Select2 4.0.0. These can be enabled by setting debug: true in your settings when initializing Select2.

  • Warnings will be displayed when debug is true and deprecated or renamed options are being used [https://github.com/select2/select2/issues/3483]
  • Options renamed in 4.0.0 are supported under their new names [https://github.com/select2/select2/issues/3483]

Bug fixes

  • Remove the remaining code for Internet Explorer 7 support [https://github.com/select2/select2/pull/2786]
  • Hide the search box if the dropdown is empty [https://github.com/select2/select2/pull/2828]
  • Improve performance issues in setVal [https://github.com/select2/select2/pull/2848]
  • Fix support for Zepto [https://github.com/select2/select2/pull/2866]
  • Properly remove event handlers when destroying [https://github.com/select2/select2/pull/2925]
  • Fix exception when no results are found using a multiple select.

This release is the final release under the 3.5.x line that will be handled by @kevin-brown. If you are interested in taking over the 3.5.x releases, contact Kevin Brown for more information.

select2 - Select2 3.5.3

Published by kevin-brown about 9 years ago

New features

This release does not add any new features, but it does add migration assistance for those who are looking to upgrade to Select2 4.0.0. These can be enabled by setting debug: true in your settings when initializing Select2.

  • Warnings will be displayed when debug is true and deprecated or renamed options are being used [https://github.com/select2/select2/issues/3483]
  • Options renamed in 4.0.0 are supported under their new names [https://github.com/select2/select2/issues/3483]

Bug fixes

  • Remove the remaining code for Internet Explorer 7 support [https://github.com/select2/select2/pull/2786]
  • Hide the search box if the dropdown is empty [https://github.com/select2/select2/pull/2828]
  • Improve performance issues in setVal [https://github.com/select2/select2/pull/2848]
  • Fix support for Zepto [https://github.com/select2/select2/pull/2866]
  • Properly remove event handlers when destroying [https://github.com/select2/select2/pull/2925]
  • Fix exception when no results are found using a multiple select.

This release is the final release under the 3.5.3 that will be handled by @kevin-brown. If you are interested in taking over the 3.5.x releases, contact Kevin Brown for more information.

select2 - Select2 4.0.0

Published by kevin-brown over 9 years ago

This is the first release of Select2 4.0. You can view the release announcement for an overview of the larger changes.

This builds upon the second release candidate, so review all previous release notes before upgrading from previous versions of Select2.

Supported environments

  • jQuery 1.7.2+
  • Modern browsers (Chrome, Firefox, Safari)
  • Internet Explorer 8+

New features

DOM Events

New

  • select2:closing is triggered before the dropdown is closed
  • select2:select is triggered when an option is selected

Renamed

  • select2-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:removed
  • select2-removing is now select2:unselecting

Removed

  • select2-clearing has been removed in favor of select2:unselecting
  • select2-highlight
  • select2-loaded
  • select2-focus
  • select2-blur
  • All extra properties from the change event were removed
    • val can be retrieved with $element.val() instead
    • added can be retrieved by listening to select2:select
    • removed can be retrieved by listening to select2:unselect
select2 - 4.0.0 Release Candidate 2

Published by kevin-brown over 9 years ago

This is the second release candidate of Select2 4.0.

This builds upon the previous release candidate, so review all previous release notes before upgrading from previous versions of Select2.

New features

  • Select2 once again is compatible with AMD/CommonJS/UMD loaders [https://github.com/select2/select2/commit/d1e8a6fdad700deba721aaf83c912e09db80eb5d]
  • Full Internet Explorer 8 and jQuery 1.7.2+ support (including automated testing)

Breaking changes

  • The select2.amd.js build no longer exists, use select2.js or select2.amd.js instead. [https://github.com/select2/select2/commit/d1e8a6fdad700deba721aaf83c912e09db80eb5d]
  • Debug messages are hidden by default, use the debug option to make them visible again [https://github.com/select2/select2/commit/78c301f4fb848d06fc91776e46ec2cf5c96b0f3b]
select2 - 4.0.0 Release Candidate 1

Published by kevin-brown over 9 years ago

This is the first release candidate of Select2 4.0.

This builds upon the previous beta release, so review all previous release notes before upgrading from previous versions of Select2.

  • This fixes many regressions that were present in previous pre-releases.

New features

  • Limited support for <input type="text" /> tags was added back in for full builds. [https://github.com/select2/select2/pull/3051]
  • Compatibility was added back for Internet Explorer 8 and Opera 12.
  • .select2('data') can once again be used to retrieve a list of the selected options (read-only). [https://github.com/select2/select2/commit/61a231d868a9c0c8e227af0c331734825a72e82d]

Breaking changes

  • Select2 no longer stops the propagation of events happening within the dropdown and selection. You can use the StopPropagation modules available in the full builds to prevent this. [https://github.com/select2/select2/commit/8f8140e3b00c5d5bb232455137c4c633d7da4275]
  • The enter key no longer toggles the state of multiple select items in the results, but instead will only select them. Use CTRL + Space instead to toggle the state. [https://github.com/select2/select2/commit/017c20109471fa5b835603faf5dc37f7c2c2ea45]
  • Warnings will now be triggered in the developer console if Select2 detects an unsupported configuration.
select2 - 4.0.0 Beta 3

Published by kevin-brown over 9 years ago

This is the third beta release of Select2 4.0.

This builds upon the previous beta release, so review all previous release notes before upgrading from previous versions of Select2.

New features

  • Added backwards compatibility with the old query and initSelection methods in the full builds.
  • Select2 is now fully compatible with most AMD loaders when using the AMD build.
  • The default values for options are now publicly accessible. You find out how to use them in the documentation.
  • Select2 will now work with jQuery.noConflict without any issues.
  • You can use more specific locales (like en-US) and Select2 will be able to determine what translation files to load.
  • Improved the warning and error messages when Select2 detects an abnormal configuration.

Breaking changes

  • The full build of Select2 no longer includes jQuery - You must include jQuery separately on your page.
  • Select2 will prevent the inner scrolling of modals (and other scrollable containers) when it is open to prevent the UI from breaking. Read more at the commit.
  • jQuery is no longer listed as a dependency in the bower.json/component.json files.

Removed events

  • select2-clearing - Removed in favor of select2:unselecting which will be triggered
select2 - 4.0.0 Beta 2

Published by kevin-brown over 9 years ago

This is the second beta release of Select2 4.0.

This builds upon the previous beta release, so review all previous release notes before upgrading from previous versions of Select2.

New features

  • The base path for automatically loading modules in AMD builds can now be changed
    • These options should be set when initializing Select2
    • Set amdPath to the base path (including trailing slash) for the select2 source
    • Set amdLanguagePath to the base path for the select2/i18n source

New events

  • select2:closing to complement select2:opening
  • select2:select to complement select2:unselect

Breaking changes

  • The default value of the width option has been changed from style to resolve.
  • The copy value for the width option has been renamed to style.

Removed events

  • select2-highlight
  • select2-loaded
  • select2-focus - Use the native focus event instead
  • select2-blur - Use the native blur event instead
  • All extra properties of change have been removed
    • val - Use $element.val() instead
    • removed - Use the select2:unselect event instead
    • added - Use the select2-selected event instead

Renamed options

  • createSearchChoice -> createTag
  • selectOnBlur -> selectOnClose

Renamed events

  • select2-open -> select2:open
  • select2-opening -> select2:opening
  • select2-close -> select2:close
  • select2-selecting -> select2:selecting
  • select2-removed -> select2:unselect
  • select2-removing -> select2:unselecting
select2 - 4.0.0 Beta 1

Published by kevin-brown almost 10 years ago

This is the first beta release of Select2 4.0.

You can view the 4.0 release announcement for a detailed look into the changes in Select2. This is a full rewrite of the core Select2 code.

New features

Breaking changes

Renamed options

  • formatSelection -> templateSelection
  • formatResult -> templateResult
  • sortResults -> sorter
  • 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)

Internationalization

  • formatNoMatches -> language.noMatches
  • formatSearching -> language.searching
  • formatInputTooShort -> language.inputTooShort
  • formatInputTooLong -> language.inputTooLong
  • formatAjaxError -> language.errorLoading
  • formatLoading -> language.loadingMore
  • formatSelectionTooBig -> language.maximumSelected

Renamed methods

  • .select2("val", [value]) -> .val([value])
  • .select2("enable", !disabled) -> .prop("disabled", disabled)

Removed options

Removed methods

  • .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 instead