diff --git a/README.md b/README.md index 8535c96..827937e 100644 --- a/README.md +++ b/README.md @@ -664,7 +664,7 @@ example.setValueByChoice('Two'); // Choice with value of 'Two' has now been sele ### ajax(fn); **Input types affected:** `select-one`, `select-multiple` -**Usage:** Populate options via a callback. +**Usage:** Populate choices/groups via a callback. **Example:** diff --git a/index.html b/index.html index 9a30f62..60163c4 100644 --- a/index.html +++ b/index.html @@ -66,21 +66,29 @@ - +

Multiple select input

- + + + - @@ -119,7 +127,7 @@ - @@ -130,7 +138,7 @@

Single select input

- @@ -146,7 +154,7 @@ - @@ -180,7 +188,7 @@ - @@ -304,6 +312,10 @@ }); }); + var multipleCancelButton = new Choices('#choices-multiple-remove-button', { + removeItemButton: true, + }) + var singleFetch = new Choices('#choices-single-remote-fetch', { placeholder: true, placeholderValue: 'Pick an Arctic Monkeys record' @@ -342,9 +354,8 @@ request.send(); }); - var genericExamples = new Choices('[data-choice]', { - placeholderValue: 'This is a placeholder set in the config', - removeButton: true, + var genericExamples = new Choices('[data-trigger]', { + placeholderValue: 'This is a placeholder set in the config' }); var singleNoSearch = new Choices('#choices-single-no-search', { @@ -420,7 +431,7 @@ choice: (data) => { return strToEl(`
0 ? 'role="treeitem"' : 'role="option"'}> - ${data.label} + 👉🏽 ${data.label}
`); },