From c295842a0336c9e967a0c5adc28ddf527876c6c6 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Thu, 31 Oct 2024 13:09:38 +0200 Subject: [PATCH] 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. --- pkg/lib/cockpit-components-typeahead-select.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/lib/cockpit-components-typeahead-select.tsx b/pkg/lib/cockpit-components-typeahead-select.tsx index cdacc0040c90..578eb6ef2db7 100644 --- a/pkg/lib/cockpit-components-typeahead-select.tsx +++ b/pkg/lib/cockpit-components-typeahead-select.tsx @@ -130,7 +130,7 @@ export interface TypeaheadSelectProps extends Omit string); /** Flag indicating the select should be disabled. */ - isDisabled: boolean; + isDisabled?: boolean; /** Width of the toggle. */ toggleWidth?: string; /** Additional props passed to the toggle. */