From 76f9042e93d26f263b1dfb6d47d46ed1b43ecf8f Mon Sep 17 00:00:00 2001 From: Maximilian Franzke Date: Mon, 17 Nov 2025 08:48:05 +0100 Subject: [PATCH 1/7] refactor(typescript): prevent any --- .../src/components/custom-select/custom-select.lite.tsx | 5 +++-- packages/components/src/components/custom-select/model.ts | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) 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..d6ade761ff9f 100644 --- a/packages/components/src/components/custom-select/custom-select.lite.tsx +++ b/packages/components/src/components/custom-select/custom-select.lite.tsx @@ -31,7 +31,8 @@ import { ClickEvent, GeneralEvent, InputEvent, - InteractionEvent + InteractionEvent, + GeneralKeyboardEvent } from '../../shared/model'; import { cls, @@ -406,7 +407,7 @@ 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..bb9815de621c 100644 --- a/packages/components/src/components/custom-select/model.ts +++ b/packages/components/src/components/custom-select/model.ts @@ -18,7 +18,8 @@ import { ShowIconProps, ShowLabelProps, ValidationType, - WidthType + WidthType, + GeneralKeyboardEvent } from '../../shared/model'; import { CustomSelectDropdownWidthType } from '../custom-select-dropdown/model'; import { DBCustomSelectFormFieldDefaultProps } from '../custom-select-form-field/model'; @@ -288,7 +289,7 @@ export type DBCustomSelectDefaultState = { handleDocumentClose: (event: any) => void; handleOpenByKeyboardFocus: () => void; handleFocusFirstDropdownCheckbox: (activeElement?: Element) => void; - handleKeyboardPress: (event: any) => void; + handleKeyboardPress: (event: GeneralKeyboardEvent) => void; handleArrowDownUp: (event: any) => void; handleSearch: (event: any) => void; handleOptionSelected: (_values: string[]) => void; From a9063dea2f1258308d15a28369aaeef54ba87952 Mon Sep 17 00:00:00 2001 From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com> Date: Mon, 17 Nov 2025 16:57:52 +0100 Subject: [PATCH 2/7] fix: Change keyboard event type in CustomSelect model --- packages/components/src/components/custom-select/model.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/components/src/components/custom-select/model.ts b/packages/components/src/components/custom-select/model.ts index bb9815de621c..3f023afb6d7e 100644 --- a/packages/components/src/components/custom-select/model.ts +++ b/packages/components/src/components/custom-select/model.ts @@ -19,7 +19,7 @@ import { ShowLabelProps, ValidationType, WidthType, - GeneralKeyboardEvent + KeyboardEvent } from '../../shared/model'; import { CustomSelectDropdownWidthType } from '../custom-select-dropdown/model'; import { DBCustomSelectFormFieldDefaultProps } from '../custom-select-form-field/model'; @@ -289,7 +289,7 @@ export type DBCustomSelectDefaultState = { handleDocumentClose: (event: any) => void; handleOpenByKeyboardFocus: () => void; handleFocusFirstDropdownCheckbox: (activeElement?: Element) => void; - handleKeyboardPress: (event: GeneralKeyboardEvent) => void; + handleKeyboardPress: (event: KeyboardEvent) => void; handleArrowDownUp: (event: any) => void; handleSearch: (event: any) => void; handleOptionSelected: (_values: string[]) => void; From d406427130c69c89b686a73cbbe99a3301e48cb3 Mon Sep 17 00:00:00 2001 From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com> Date: Mon, 17 Nov 2025 16:57:59 +0100 Subject: [PATCH 3/7] fix: Refactor keyboard event handling in custom select --- .../src/components/custom-select/custom-select.lite.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 d6ade761ff9f..1240b87c36f8 100644 --- a/packages/components/src/components/custom-select/custom-select.lite.tsx +++ b/packages/components/src/components/custom-select/custom-select.lite.tsx @@ -32,7 +32,7 @@ import { GeneralEvent, InputEvent, InteractionEvent, - GeneralKeyboardEvent + KeyboardEvent } from '../../shared/model'; import { cls, @@ -407,7 +407,7 @@ export default function DBCustomSelect(props: DBCustomSelectProps) { event.stopPropagation(); event.preventDefault(); }, - handleKeyboardPress: (event: GeneralKeyboardEvent) => { + handleKeyboardPress: (event: KeyboardEvent) => { event.stopPropagation(); if (event.key === 'Escape' && detailsRef?.open) { state.handleClose(undefined, true); From d4d71eca5e4ddc91c7d7ca150a252725713a3c8e Mon Sep 17 00:00:00 2001 From: Maximilian Franzke Date: Mon, 17 Nov 2025 17:16:38 +0100 Subject: [PATCH 4/7] refactor: switched back to GeneralKeyboardEvent --- .../src/components/custom-select/custom-select.lite.tsx | 8 +++++--- packages/components/src/components/custom-select/model.ts | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) 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 1240b87c36f8..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,9 +30,9 @@ import { import { ClickEvent, GeneralEvent, + GeneralKeyboardEvent, InputEvent, - InteractionEvent, - KeyboardEvent + InteractionEvent } from '../../shared/model'; import { cls, @@ -407,7 +407,9 @@ export default function DBCustomSelect(props: DBCustomSelectProps) { event.stopPropagation(); event.preventDefault(); }, - handleKeyboardPress: (event: KeyboardEvent) => { + 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 3f023afb6d7e..dde66d8d1870 100644 --- a/packages/components/src/components/custom-select/model.ts +++ b/packages/components/src/components/custom-select/model.ts @@ -8,6 +8,7 @@ import { FormState, FromValidState, GeneralEvent, + GeneralKeyboardEvent, GlobalProps, GlobalState, IconProps, @@ -18,8 +19,7 @@ import { ShowIconProps, ShowLabelProps, ValidationType, - WidthType, - KeyboardEvent + WidthType } from '../../shared/model'; import { CustomSelectDropdownWidthType } from '../custom-select-dropdown/model'; import { DBCustomSelectFormFieldDefaultProps } from '../custom-select-form-field/model'; @@ -289,7 +289,9 @@ export type DBCustomSelectDefaultState = { handleDocumentClose: (event: any) => void; handleOpenByKeyboardFocus: () => void; handleFocusFirstDropdownCheckbox: (activeElement?: Element) => void; - handleKeyboardPress: (event: KeyboardEvent) => void; + handleKeyboardPress: ( + event: GeneralKeyboardEvent + ) => void; handleArrowDownUp: (event: any) => void; handleSearch: (event: any) => void; handleOptionSelected: (_values: string[]) => void; From 7d740233f12ce7dddd70a783e5a0a783613fed2e Mon Sep 17 00:00:00 2001 From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com> Date: Mon, 17 Nov 2025 17:48:20 +0100 Subject: [PATCH 5/7] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- packages/components/src/components/custom-select/model.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/components/src/components/custom-select/model.ts b/packages/components/src/components/custom-select/model.ts index dde66d8d1870..74cc13d3061c 100644 --- a/packages/components/src/components/custom-select/model.ts +++ b/packages/components/src/components/custom-select/model.ts @@ -286,14 +286,14 @@ export type DBCustomSelectDefaultState = { handleSelectAll: (event: any) => void; handleClearAll: (event: any) => void; handleDropdownToggle: (event: any) => void; - handleDocumentClose: (event: any) => void; + handleDocumentClose: (event: GeneralEvent) => void; handleOpenByKeyboardFocus: () => void; handleFocusFirstDropdownCheckbox: (activeElement?: Element) => void; handleKeyboardPress: ( event: GeneralKeyboardEvent ) => void; - handleArrowDownUp: (event: any) => void; - handleSearch: (event: any) => void; + handleArrowDownUp: (event: GeneralKeyboardEvent) => void; + handleSearch: (valueOrEvent?: InputEvent | string | void) => void; handleOptionSelected: (_values: string[]) => void; getSelectAllLabel: () => string; selectAllChecked: boolean; From 608c71308352f345d0895c57245cb23e4baac8d3 Mon Sep 17 00:00:00 2001 From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com> Date: Sun, 23 Nov 2025 11:26:53 +0100 Subject: [PATCH 6/7] Update packages/components/src/components/custom-select/model.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- packages/components/src/components/custom-select/model.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/components/src/components/custom-select/model.ts b/packages/components/src/components/custom-select/model.ts index 74cc13d3061c..cf63330ba663 100644 --- a/packages/components/src/components/custom-select/model.ts +++ b/packages/components/src/components/custom-select/model.ts @@ -283,9 +283,9 @@ export type DBCustomSelectDefaultState = { ) => void; handleSummaryFocus: () => void; handleSelect: (value?: string) => void; - handleSelectAll: (event: any) => void; - handleClearAll: (event: any) => void; - handleDropdownToggle: (event: any) => void; + handleSelectAll: (event: InputEvent) => void; + handleClearAll: (event: InputEvent) => void; + handleDropdownToggle: (event: GeneralEvent) => void; handleDocumentClose: (event: GeneralEvent) => void; handleOpenByKeyboardFocus: () => void; handleFocusFirstDropdownCheckbox: (activeElement?: Element) => void; From 9c09a53f8f067039a6752503b73a0cbf759d821e Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Dec 2025 16:53:07 +0100 Subject: [PATCH 7/7] fix: correct event types for handleSelectAll and handleClearAll (#5584) * Initial plan * fix: change handleSelectAll and handleClearAll parameter types to ChangeEvent Co-authored-by: mfranzke <787658+mfranzke@users.noreply.github.com> * fix: correct handleClearAll to use ClickEvent for onClick handler Co-authored-by: mfranzke <787658+mfranzke@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] Co-authored-by: mfranzke <787658+mfranzke@users.noreply.github.com> --- .../components/src/components/custom-select/model.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/components/src/components/custom-select/model.ts b/packages/components/src/components/custom-select/model.ts index cf63330ba663..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, @@ -283,8 +284,8 @@ export type DBCustomSelectDefaultState = { ) => void; handleSummaryFocus: () => void; handleSelect: (value?: string) => void; - handleSelectAll: (event: InputEvent) => void; - handleClearAll: (event: InputEvent) => void; + handleSelectAll: (event: ChangeEvent) => void; + handleClearAll: (event: ClickEvent) => void; handleDropdownToggle: (event: GeneralEvent) => void; handleDocumentClose: (event: GeneralEvent) => void; handleOpenByKeyboardFocus: () => void; @@ -293,7 +294,9 @@ export type DBCustomSelectDefaultState = { event: GeneralKeyboardEvent ) => void; handleArrowDownUp: (event: GeneralKeyboardEvent) => void; - handleSearch: (valueOrEvent?: InputEvent | string | void) => void; + handleSearch: ( + valueOrEvent?: InputEvent | string | void + ) => void; handleOptionSelected: (_values: string[]) => void; getSelectAllLabel: () => string; selectAllChecked: boolean;