diff --git a/pages/01.getting-started/01.installation/docs.md b/pages/01.getting-started/01.installation/docs.md index 99181507..2ba240db 100644 --- a/pages/01.getting-started/01.installation/docs.md +++ b/pages/01.getting-started/01.installation/docs.md @@ -13,8 +13,8 @@ A CDN (content delivery network) is the fastest way to get up and running with S Select2 is hosted on both the [cdnjs](https://cdnjs.com/libraries/select2) and [jsDelivr](https://www.jsdelivr.com/#!select2) CDNs. Simply include the following lines of code in the `
` section of your page: ``` - - + + ``` >>> Immediately following a new release, it takes some time for CDNs to catch up and get the new versions live on the CDN. diff --git a/pages/03.configuration/01.options-api/docs.md b/pages/03.configuration/01.options-api/docs.md index d01c35dd..06af83c7 100644 --- a/pages/03.configuration/01.options-api/docs.md +++ b/pages/03.configuration/01.options-api/docs.md @@ -1,10 +1,10 @@ --- -title: Configuration API +title: Options taxonomy: category: docs --- -The following is an attempt to provide a comprehensive list of all configuration options available in Select2. +This is a list of all the Select 2 configuration options. | Option | Type | Default | Description | | ------ | ---- | ------- | ----------- | @@ -15,7 +15,7 @@ The following is an attempt to provide a comprehensive list of all configuration | `amdBase` | string | `./` | See [Using Select2 with AMD or CommonJS loaders](/builds-and-modules#using-select2-with-amd-or-commonjs-loaders). | | `amdLanguageBase` | string | `./i18n/` | See [Using Select2 with AMD or CommonJS loaders](/builds-and-modules#using-select2-with-amd-or-commonjs-loaders). | | `closeOnSelect` | boolean | `true` | Controls whether the dropdown is [closed after a selection is made](/dropdown#forcing-the-dropdown-to-remain-open-after-selection). | -| `containerCss` | | | | +| `containerCss` | object | null | Adds custom CSS to the container. Expects key-value pairs: `{ 'css-property': 'value' }` | | `containerCssClass` | string | `''` | | | `data` | array of objects | `null` | Allows rendering dropdown options from an [array](/data-sources/arrays). | | `dataAdapter` | | `SelectAdapter` | Used to override the built-in [DataAdapter](/advanced/default-adapters/data). | @@ -24,7 +24,7 @@ The following is an attempt to provide a comprehensive list of all configuration | `disabled` | boolean | `false` | When set to `true`, the select control will be disabled. | | `dropdownAdapter` | | `DropdownAdapter` | Used to override the built-in [DropdownAdapter](/advanced/default-adapters/dropdown) | | `dropdownAutoWidth` | boolean | `false` | | -| `dropdownCss` | | | | +| `dropdownCss` | object | null | Adds custom CSS to the dropdown. Expects key-value pairs: `{ 'css-property': 'value' }` | | `dropdownCssClass` | string | `''` | | | `dropdownParent` | jQuery selector or DOM node | `$(document.body)` | Allows you to [customize placement](/dropdown#dropdown-placement) of the dropdown. | | `escapeMarkup` | callback | `Utils.escapeMarkup` | Handles [automatic escaping of content rendered by custom templates](/dropdown#built-in-escaping). | @@ -49,3 +49,4 @@ The following is an attempt to provide a comprehensive list of all configuration | `tokenizer` | callback | | A callback that handles [automatic tokenization of free-text entry](/tagging#automatic-tokenization-into-tags). | | `tokenSeparators` | array | `[]` | The list of characters that should be used as token separators. | | `width` | string | `resolve` | Supports [customization of the container width](/appearance#container-width). | +| `scrollAfterSelect` | boolean | `false` | If `true`, resolves issue for multiselects using `closeOnSelect: false` that caused the list of results to scroll to the first selection after each select/unselect (see https://github.com/select2/select2/pull/5150). This behaviour was intentional to deal with infinite scroll UI issues (if you need this behavior, set `false`) but it created an issue with multiselect dropdown boxes of fixed length. This pull request adds a configurable option to toggle between these two desirable behaviours. | diff --git a/pages/06.data-sources/01.formats/docs.md b/pages/06.data-sources/01.formats/docs.md index befadeab..73d044b2 100644 --- a/pages/06.data-sources/01.formats/docs.md +++ b/pages/06.data-sources/01.formats/docs.md @@ -24,7 +24,7 @@ Select2 can render programmatically supplied data from an array or remote data s } ``` -Each object should contain, _at a minimum_, an `id` and a `text` property. Any additional parameters passed in with data objects will be included on the data objects that Select2 exposes. +Select2 requires that each object contain an `id` and a `text` property. Additional parameters passed in with data objects will be included on the data objects that Select2 exposes. The response object may also contain pagination data, if you would like to use the "infinite scroll" feature. This should be specified under the `pagination` key. diff --git a/pages/06.data-sources/02.ajax/docs.md b/pages/06.data-sources/02.ajax/docs.md index 4dd177e1..70aa31b2 100644 --- a/pages/06.data-sources/02.ajax/docs.md +++ b/pages/06.data-sources/02.ajax/docs.md @@ -37,7 +37,7 @@ You can configure how Select2 searches for remote data using the `ajax` option. ## Request parameters -Select2 will issue a request to the specified URL when the user opens the control (unless there is a `minimumInputLength` set), and again every time the user types in the search box. By default, it will send the following as query string parameters: +Select2 will issue a request to the specified URL when the user opens the control (unless there is a `minimumInputLength` set as a Select2 option), and again every time the user types in the search box. By default, it will send the following as query string parameters: - `term` : The current search term in the search box. - `q` : Contains the same contents as `term`. @@ -74,7 +74,7 @@ $('#mySelect2').select2({ ajax: { url: '/example/api', processResults: function (data) { - // Tranforms the top-level key of the response object from 'items' to 'results' + // Transforms the top-level key of the response object from 'items' to 'results' return { results: data.items }; @@ -309,7 +309,6 @@ $(".js-example-data-ajax").select2({ cache: true }, placeholder: 'Search for a repository', - escapeMarkup: function (markup) { return markup; }, // let our custom formatter work minimumInputLength: 1, templateResult: formatRepo, templateSelection: formatRepoSelection @@ -320,23 +319,28 @@ function formatRepo (repo) { return repo.text; } - var markup = "