mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-21 15:06:45 +02:00
Update read me + minor tweak
This commit is contained in:
parent
76df544677
commit
57586c0e3d
|
@ -60,6 +60,7 @@ A vanilla, lightweight (~15kb gzipped 🎉), configurable select box/text input
|
|||
loadingText: 'Loading...',
|
||||
noResultsText: 'No results round',
|
||||
noChoicesText: 'No choices to choose from',
|
||||
itemSelectText: 'Press to select',
|
||||
classNames: {
|
||||
containerOuter: 'choices',
|
||||
containerInner: 'choices__inner',
|
||||
|
@ -316,6 +317,13 @@ const example = new Choices(element, {
|
|||
|
||||
**Usage:** The text that is shown when a user has selected all possible choices.
|
||||
|
||||
### itemSelectText
|
||||
**Type:** `String` **Default:** `Press to select`
|
||||
|
||||
**Input types affected:** `select-multiple`, `select-one`
|
||||
|
||||
**Usage:** The text that is shown when a user hovers over a selectable choice.
|
||||
|
||||
### classNames
|
||||
**Type:** `Object` **Default:**
|
||||
|
||||
|
|
|
@ -1703,7 +1703,6 @@ export default class Choices {
|
|||
* @private
|
||||
*/
|
||||
_createTemplates() {
|
||||
const config = this.config;
|
||||
const classNames = this.config.classNames;
|
||||
const templates = {
|
||||
containerOuter: (direction) => {
|
||||
|
@ -1767,7 +1766,7 @@ export default class Choices {
|
|||
choice: (data) => {
|
||||
return strToEl(
|
||||
`
|
||||
<div class="${classNames.item} ${classNames.itemChoice} ${data.disabled ? classNames.itemDisabled : classNames.itemSelectable}" data-select-text="${config.itemSelectText}" data-choice ${data.disabled ? 'data-choice-disabled aria-disabled="true"' : 'data-choice-selectable'} data-id="${data.id}" data-value="${data.value}" ${data.groupId > 0 ? 'role="treeitem"' : 'role="option"'}>
|
||||
<div class="${classNames.item} ${classNames.itemChoice} ${data.disabled ? classNames.itemDisabled : classNames.itemSelectable}" data-select-text="${this.config.itemSelectText}" data-choice ${data.disabled ? 'data-choice-disabled aria-disabled="true"' : 'data-choice-selectable'} data-id="${data.id}" data-value="${data.value}" ${data.groupId > 0 ? 'role="treeitem"' : 'role="option"'}>
|
||||
${data.label}
|
||||
</div>
|
||||
`
|
||||
|
|
Loading…
Reference in a new issue