diff --git a/packages/components/src/components/custom-select/custom-select.lite.tsx b/packages/components/src/components/custom-select/custom-select.lite.tsx index 1de33e3016ab..2360a5cf060b 100644 --- a/packages/components/src/components/custom-select/custom-select.lite.tsx +++ b/packages/components/src/components/custom-select/custom-select.lite.tsx @@ -30,6 +30,7 @@ import { import { ClickEvent, GeneralEvent, + GeneralKeyboardEvent, InputEvent, InteractionEvent } from '../../shared/model'; @@ -406,7 +407,9 @@ export default function DBCustomSelect(props: DBCustomSelectProps) { event.stopPropagation(); event.preventDefault(); }, - handleKeyboardPress: (event: any) => { + handleKeyboardPress: ( + event: GeneralKeyboardEvent + ) => { event.stopPropagation(); if (event.key === 'Escape' && detailsRef?.open) { state.handleClose(undefined, true); diff --git a/packages/components/src/components/custom-select/model.ts b/packages/components/src/components/custom-select/model.ts index 45df66417cc7..689615049e4d 100644 --- a/packages/components/src/components/custom-select/model.ts +++ b/packages/components/src/components/custom-select/model.ts @@ -1,5 +1,6 @@ import { BaseFormProps, + ChangeEvent, ClickEvent, CloseEventState, CustomFormProps, @@ -8,6 +9,7 @@ import { FormState, FromValidState, GeneralEvent, + GeneralKeyboardEvent, GlobalProps, GlobalState, IconProps, @@ -282,15 +284,19 @@ export type DBCustomSelectDefaultState = { ) => void; handleSummaryFocus: () => void; handleSelect: (value?: string) => void; - handleSelectAll: (event: any) => void; - handleClearAll: (event: any) => void; - handleDropdownToggle: (event: any) => void; - handleDocumentClose: (event: any) => void; + handleSelectAll: (event: ChangeEvent) => void; + handleClearAll: (event: ClickEvent) => void; + handleDropdownToggle: (event: GeneralEvent) => void; + handleDocumentClose: (event: GeneralEvent) => void; handleOpenByKeyboardFocus: () => void; handleFocusFirstDropdownCheckbox: (activeElement?: Element) => void; - handleKeyboardPress: (event: any) => void; - handleArrowDownUp: (event: any) => void; - handleSearch: (event: any) => void; + handleKeyboardPress: ( + event: GeneralKeyboardEvent + ) => void; + handleArrowDownUp: (event: GeneralKeyboardEvent) => void; + handleSearch: ( + valueOrEvent?: InputEvent | string | void + ) => void; handleOptionSelected: (_values: string[]) => void; getSelectAllLabel: () => string; selectAllChecked: boolean;