mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
docs(multi-select): add no sort example
This commit is contained in:
parent
3b24d21168
commit
6bc47cb5fa
1 changed files with 13 additions and 0 deletions
|
@ -5,12 +5,25 @@
|
||||||
|
|
||||||
### Default
|
### Default
|
||||||
|
|
||||||
|
By default, items will be ordered alphabetically based on the `item.text` value. To prevent this, see [#no-alphabetical-ordering](#no-alphabetical-ordering).
|
||||||
|
|
||||||
<MultiSelect titleText="Contact" label="Select contact methods..."
|
<MultiSelect titleText="Contact" label="Select contact methods..."
|
||||||
items="{[{id: "0", text: "Slack"},
|
items="{[{id: "0", text: "Slack"},
|
||||||
{id: "1", text: "Email"},
|
{id: "1", text: "Email"},
|
||||||
{id: "2", text: "Fax"}]}" selectedIds="{["0", "1"]}"
|
{id: "2", text: "Fax"}]}" selectedIds="{["0", "1"]}"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
### No alphabetical ordering
|
||||||
|
|
||||||
|
To prevent alphabetical item ordering, pass an empty function to the `sortItem` prop.
|
||||||
|
|
||||||
|
<MultiSelect titleText="Contact" label="Select contact methods..."
|
||||||
|
items="{[{id: "0", text: "Slack"},
|
||||||
|
{id: "1", text: "Email"},
|
||||||
|
{id: "2", text: "Fax"}]}" selectedIds="{["0", "1"]}"
|
||||||
|
sortItem="{() => {}}"
|
||||||
|
/>
|
||||||
|
|
||||||
### Light variant
|
### Light variant
|
||||||
|
|
||||||
<MultiSelect light titleText="Contact" label="Select contact methods..."
|
<MultiSelect light titleText="Contact" label="Select contact methods..."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue