mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
feat: support item.disabled
key for Dropdown
, MultiSelect
, ComboBox
(#1328)
Closes #1326 * feat: support item.disabled key for `Dropdown`, `MultiSelect`, `ComboBox` * Run "yarn build:docs" * test: assert disabled property * docs: add "Disabled items" examples
This commit is contained in:
parent
22f93ee675
commit
f25a10c9c4
16 changed files with 150 additions and 19 deletions
|
@ -5,6 +5,9 @@
|
|||
/** Set to `true` to enable the highlighted state */
|
||||
export let highlighted = false;
|
||||
|
||||
/** Set to `true` to disable the menu item */
|
||||
export let disabled = false;
|
||||
|
||||
let ref = null;
|
||||
|
||||
$: isTruncated = ref?.offsetWidth < ref?.scrollWidth;
|
||||
|
@ -17,6 +20,7 @@
|
|||
class:bx--list-box__menu-item--active="{active}"
|
||||
class:bx--list-box__menu-item--highlighted="{highlighted}"
|
||||
aria-selected="{active}"
|
||||
disabled="{disabled ? true : undefined}"
|
||||
{...$$restProps}
|
||||
on:click
|
||||
on:mouseenter
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue