Skip to content

Commit d780150

Browse files
committed
chore: move focus props to internal
1 parent b0885ef commit d780150

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

src/dropdown/interfaces.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -100,21 +100,6 @@ export interface DropdownProps extends ExpandToViewport {
100100
*/
101101
maxWidth?: number;
102102

103-
/**
104-
* Hides the block (top/bottom) borders of the dropdown content wrapper.
105-
*/
106-
hideBlockBorder?: boolean;
107-
108-
/**
109-
* Called when focus enters the trigger or dropdown content.
110-
*/
111-
onFocus?: NonCancelableEventHandler<Pick<React.FocusEvent, 'target' | 'relatedTarget'>>;
112-
113-
/**
114-
* Called when focus leaves the trigger or dropdown content.
115-
*/
116-
onBlur?: NonCancelableEventHandler<Pick<React.FocusEvent, 'target' | 'relatedTarget'>>;
117-
118103
/**
119104
* Called when the user presses the Escape key while the dropdown is open.
120105
* The dropdown does not close automatically - the parent component

src/dropdown/internal.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { getBaseProps } from '../internal/base-component';
1212
import { getFirstFocusable, getLastFocusable } from '../internal/components/focus-lock/utils.js';
1313
import TabTrap from '../internal/components/tab-trap/index.js';
1414
import { Transition, TransitionStatus } from '../internal/components/transition';
15-
import { fireNonCancelableEvent } from '../internal/events';
15+
import { fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events';
1616
import customCssProps from '../internal/generated/custom-css-properties';
1717
import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
1818
import { useMobile } from '../internal/hooks/use-mobile';
@@ -29,9 +29,7 @@ import {
2929
import { applyDropdownPositionRelativeToViewport, LogicalDOMRect } from './dropdown-position';
3030
import { DropdownAlignment, DropdownProps, DropdownWidthConstraint } from './interfaces';
3131

32-
interface InternalDropdownProps
33-
extends Omit<DropdownProps, 'minWidth' | 'maxWidth' | 'preferredAlignment'>,
34-
InternalBaseComponentProps {
32+
interface InternalDropdownProps extends Omit<DropdownProps, 'minWidth' | 'maxWidth'>, InternalBaseComponentProps {
3533
onMouseDown?: React.MouseEventHandler;
3634
contentKey?: string;
3735
dropdownId?: string;
@@ -44,6 +42,9 @@ interface InternalDropdownProps
4442
minWidth?: DropdownWidthConstraint;
4543
maxWidth?: DropdownWidthConstraint;
4644
preferredAlignment?: DropdownAlignment;
45+
hideBlockBorder?: boolean;
46+
onFocus?: NonCancelableEventHandler<Pick<React.FocusEvent, 'target' | 'relatedTarget'>>;
47+
onBlur?: NonCancelableEventHandler<Pick<React.FocusEvent, 'target' | 'relatedTarget'>>;
4748
}
4849

4950
import styles from './styles.css.js';

0 commit comments

Comments
 (0)