Skip to content

Commit

Permalink
lib: Fix TypeScript error in TypeaheadSelect correctly
Browse files Browse the repository at this point in the history
The "isDisabled" in the props needs to remain optional, otherwise
every user has to provide it. The default value in the function does
nothing for this.

The real problem was assigning that to MenuToggleProps, but there the
default value will make sure that isDisabled is not undefined anymore.
  • Loading branch information
mvollmer authored and jelly committed Nov 6, 2024
1 parent 581c509 commit c295842
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/lib/cockpit-components-typeahead-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export interface TypeaheadSelectProps extends Omit<SelectProps, 'toggle' | 'onSe
/** Message to display when no options match the filter. */
noOptionsFoundMessage?: string | ((filter: string) => string);
/** Flag indicating the select should be disabled. */
isDisabled: boolean;
isDisabled?: boolean;
/** Width of the toggle. */
toggleWidth?: string;
/** Additional props passed to the toggle. */
Expand Down

0 comments on commit c295842

Please sign in to comment.