Skip to content

Commit

Permalink
review: update disabled typings and remove todos
Browse files Browse the repository at this point in the history
  • Loading branch information
JoCa96 committed Jan 17, 2025
1 parent ab7d543 commit 6ffb13c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 1 addition & 4 deletions packages/sit-onyx/src/components/OnyxSelect/OnyxSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -415,17 +415,14 @@ defineExpose({ input: computed(() => selectInput.value?.input) });
>
{{ group }}
</li>
<!-- TODO: remove type cast once its fixed in Vue / vue-tsc version -->
<OnyxSelectOption
v-for="option in groupOptions"
:key="option.value.toString()"
v-bind="
headlessOption({
value: option.value,
label: option.label,
disabled: option.disabled as any,
// TODO: remove type cast once its fixed in Vue / vue-tsc version
disabled: option.disabled,
selected: arrayValue.some((value: TValue) => value === option.value),
})
"
Expand Down
6 changes: 5 additions & 1 deletion packages/sit-onyx/src/components/OnyxSelect/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,13 @@ export type OnyxSelectProps<

export type SelectOption<TValue extends SelectOptionValue = SelectOptionValue> = Pick<
BaseSelectOption<TValue>,
"value" | "label" | "disabled" | "truncation"
"value" | "label" | "truncation"
> &
Pick<OnyxSelectOptionProps, "icon"> & {
/**
* Disables the option and prevents it from being selected.
*/
disabled?: boolean;
/**
* Optional group name. If set, all options with the same group name will be grouped below that name.
* If `group` is used for one option, it should be used for all other options as well.
Expand Down

0 comments on commit 6ffb13c

Please sign in to comment.