Skip to content

Commit c295842

Browse files
mvollmerjelly
authored andcommitted
lib: Fix TypeScript error in TypeaheadSelect correctly
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.
1 parent 581c509 commit c295842

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/lib/cockpit-components-typeahead-select.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export interface TypeaheadSelectProps extends Omit<SelectProps, 'toggle' | 'onSe
130130
/** Message to display when no options match the filter. */
131131
noOptionsFoundMessage?: string | ((filter: string) => string);
132132
/** Flag indicating the select should be disabled. */
133-
isDisabled: boolean;
133+
isDisabled?: boolean;
134134
/** Width of the toggle. */
135135
toggleWidth?: string;
136136
/** Additional props passed to the toggle. */

0 commit comments

Comments
 (0)