Skip to content

Commit d4d71ec

Browse files
committed
refactor: switched back to GeneralKeyboardEvent
1 parent d406427 commit d4d71ec

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

packages/components/src/components/custom-select/custom-select.lite.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ import {
3030
import {
3131
ClickEvent,
3232
GeneralEvent,
33+
GeneralKeyboardEvent,
3334
InputEvent,
34-
InteractionEvent,
35-
KeyboardEvent
35+
InteractionEvent
3636
} from '../../shared/model';
3737
import {
3838
cls,
@@ -407,7 +407,9 @@ export default function DBCustomSelect(props: DBCustomSelectProps) {
407407
event.stopPropagation();
408408
event.preventDefault();
409409
},
410-
handleKeyboardPress: (event: KeyboardEvent<HTMLDetailsElement>) => {
410+
handleKeyboardPress: (
411+
event: GeneralKeyboardEvent<HTMLDetailsElement>
412+
) => {
411413
event.stopPropagation();
412414
if (event.key === 'Escape' && detailsRef?.open) {
413415
state.handleClose(undefined, true);

packages/components/src/components/custom-select/model.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
FormState,
99
FromValidState,
1010
GeneralEvent,
11+
GeneralKeyboardEvent,
1112
GlobalProps,
1213
GlobalState,
1314
IconProps,
@@ -18,8 +19,7 @@ import {
1819
ShowIconProps,
1920
ShowLabelProps,
2021
ValidationType,
21-
WidthType,
22-
KeyboardEvent
22+
WidthType
2323
} from '../../shared/model';
2424
import { CustomSelectDropdownWidthType } from '../custom-select-dropdown/model';
2525
import { DBCustomSelectFormFieldDefaultProps } from '../custom-select-form-field/model';
@@ -289,7 +289,9 @@ export type DBCustomSelectDefaultState = {
289289
handleDocumentClose: (event: any) => void;
290290
handleOpenByKeyboardFocus: () => void;
291291
handleFocusFirstDropdownCheckbox: (activeElement?: Element) => void;
292-
handleKeyboardPress: (event: KeyboardEvent<HTMLDetailsElement>) => void;
292+
handleKeyboardPress: (
293+
event: GeneralKeyboardEvent<HTMLDetailsElement>
294+
) => void;
293295
handleArrowDownUp: (event: any) => void;
294296
handleSearch: (event: any) => void;
295297
handleOptionSelected: (_values: string[]) => void;

0 commit comments

Comments
 (0)