carbon-design-system / carbon-components-svelte

Svelte implementation of the Carbon Design System
https://svelte.carbondesignsystem.com
Apache License 2.0
2.71k stars 261 forks source link

`SelectItem` properties `style`/`class` missing from types. #1839

Closed brunnerh closed 1 year ago

brunnerh commented 1 year ago

The values for style/class are pulled from $$restProps but the types only contain the defined props, leading to errors when using TypeScript.

https://github.com/carbon-design-system/carbon-components-svelte/blob/fee236194bbfc7aa9225fe694aa0c7fc098dd6dc/src/Select/SelectItem.svelte#L35-L43

Properties should probably either be explicit or all $$restProps should be spread along with a /** @restProps {option} */ annotation.

metonym commented 1 year ago

Spreading $$restProps previously caused a bug that broke select bindings (https://github.com/carbon-design-system/carbon-components-svelte/pull/452). However, that was three years ago, and I haven't look into if it works.

metonym commented 1 year ago

Fixed in v0.81.3