Skip to content

Commit 45449de

Browse files
committed
fix(Select): improve type consistency in onSelect
1 parent 14e29d8 commit 45449de

File tree

1 file changed

+2
-1
lines changed
  • packages/react-core/src/components/Select

1 file changed

+2
-1
lines changed

packages/react-core/src/components/Select/Select.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { css } from '@patternfly/react-styles';
33
import { Menu, MenuContent, MenuProps } from '../Menu';
44
import { Popper } from '../../helpers/Popper/Popper';
55
import { getOUIAProps, OUIAProps, getDefaultOUIAId, onToggleArrowKeydownDefault } from '../../helpers';
6+
import type { SelectOptionProps } from './SelectOption';
67

78
export interface SelectPopperProps {
89
/** Vertical direction of the popper. If enableFlip is set to true, this will set the initial direction before the popper flips. */
@@ -56,7 +57,7 @@ export interface SelectProps extends MenuProps, OUIAProps {
5657
/** @beta Flag indicating the first menu item should be focused after opening the menu. */
5758
shouldFocusFirstItemOnOpen?: boolean;
5859
/** Function callback when user selects an option. */
59-
onSelect?: (event?: React.MouseEvent<Element, MouseEvent>, value?: string | number) => void;
60+
onSelect?: (event?: React.MouseEvent<Element, MouseEvent>, value?: SelectOptionProps['value']) => void;
6061
/** Callback to allow the select component to change the open state of the menu.
6162
* Triggered by clicking outside of the menu, or by pressing any keys specified in onOpenChangeKeys. */
6263
onOpenChange?: (isOpen: boolean) => void;

0 commit comments

Comments
 (0)