Skip to content

Commit 632b175

Browse files
committed
fix: typescript error
1 parent ac3540d commit 632b175

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/dropdown/internal.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ import {
2929
import { applyDropdownPositionRelativeToViewport, LogicalDOMRect } from './dropdown-position';
3030
import { DropdownAlignment, DropdownProps, DropdownWidthConstraint } from './interfaces';
3131

32-
interface InternalDropdownProps extends Omit<DropdownProps, 'minWidth' | 'maxWidth'>, InternalBaseComponentProps {
32+
export interface InternalDropdownProps
33+
extends Omit<DropdownProps, 'minWidth' | 'maxWidth'>,
34+
InternalBaseComponentProps {
3335
onMouseDown?: React.MouseEventHandler;
3436
contentKey?: string;
3537
dropdownId?: string;

src/select/utils/use-select.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { useEffect, useRef } from 'react';
55

66
import { useUniqueId } from '@cloudscape-design/component-toolkit/internal';
77

8+
import { InternalDropdownProps } from '../../dropdown/internal';
89
import { ButtonTriggerProps } from '../../internal/components/button-trigger';
910
import { DropdownStatusProps } from '../../internal/components/dropdown-status';
1011
import { DropdownOption, OptionDefinition, OptionGroup } from '../../internal/components/option/interfaces';
@@ -173,12 +174,10 @@ export function useSelect({
173174
goHome: goHomeWithKeyboard,
174175
});
175176

176-
const getDropdownProps: () => {
177-
onFocus: NonCancelableEventHandler;
178-
onBlur: NonCancelableEventHandler;
179-
dropdownContentId?: string;
180-
ariaRole?: string;
181-
} = () => ({
177+
const getDropdownProps: () => Pick<
178+
InternalDropdownProps,
179+
'onFocus' | 'onBlur' | 'dropdownContentId' | 'ariaRole'
180+
> = () => ({
182181
onFocus: handleFocus,
183182
onBlur: handleBlur,
184183
dropdownContentId: dialogId,

0 commit comments

Comments
 (0)