mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 11:36:36 +00:00
feat(select-item): spread rest props, avoid $ variable name
This commit is contained in:
parent
84c0ca536e
commit
90bd2a10b7
3 changed files with 6 additions and 6 deletions
|
@ -6428,7 +6428,8 @@
|
|||
],
|
||||
"slots": [],
|
||||
"events": [],
|
||||
"typedefs": []
|
||||
"typedefs": [],
|
||||
"rest_props": { "type": "Element", "name": "option" }
|
||||
},
|
||||
{
|
||||
"moduleName": "SelectItemGroup",
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
let selected = false;
|
||||
|
||||
const unsubscribe = ctx.selectedValue.subscribe(($) => {
|
||||
selected = $ === value;
|
||||
const unsubscribe = ctx.selectedValue.subscribe((currentValue) => {
|
||||
selected = currentValue === value;
|
||||
});
|
||||
|
||||
onDestroy(() => {
|
||||
|
@ -32,8 +32,7 @@
|
|||
hidden="{hidden}"
|
||||
selected="{selected}"
|
||||
class:bx--select-option="{true}"
|
||||
class="{$$restProps.class}"
|
||||
style="{$$restProps.style}"
|
||||
{...$$restProps}
|
||||
>
|
||||
{text || value}
|
||||
</option>
|
||||
|
|
2
types/Select/SelectItem.d.ts
vendored
2
types/Select/SelectItem.d.ts
vendored
|
@ -1,6 +1,6 @@
|
|||
/// <reference types="svelte" />
|
||||
|
||||
export interface SelectItemProps {
|
||||
export interface SelectItemProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["option"]> {
|
||||
/**
|
||||
* Specify the option value
|
||||
* @default ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue