Skip to content

Commit a53d25c

Browse files
Fix Unavailable MenuItem props (#5153)
Co-authored-by: Daniel Lu <dl1644@gmail.com>
1 parent fc4488f commit a53d25c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

packages/@react-spectrum/menu/src/ContextualHelpTrigger.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,20 @@ import {Modal, Popover} from '@react-spectrum/overlays';
1919
import React, {Key, ReactElement, useRef} from 'react';
2020
import {useOverlayTriggerState} from '@react-stately/overlays';
2121

22-
interface MenuDialogTriggerProps<T> extends ItemProps<T> {
22+
interface MenuDialogTriggerProps {
2323
/** Whether the menu item is currently unavailable. */
2424
isUnavailable?: boolean,
2525
/** The triggering Item and the Dialog, respectively. */
26-
children: [ReactElement, ReactElement],
26+
children: [ReactElement, ReactElement]
27+
}
28+
29+
interface InternalMenuDialogTriggerProps extends MenuDialogTriggerProps {
2730
targetKey: Key
2831
}
2932

30-
export interface SpectrumMenuDialogTriggerProps<T> extends Omit<MenuDialogTriggerProps<T>, 'targetKey' | 'title' | 'textValue' | 'childItems' | 'hasChildItems'> {}
33+
export interface SpectrumMenuDialogTriggerProps extends MenuDialogTriggerProps {}
3134

32-
function ContextualHelpTrigger<T>(props: MenuDialogTriggerProps<T>): ReactElement {
35+
function ContextualHelpTrigger(props: InternalMenuDialogTriggerProps): ReactElement {
3336
let {isUnavailable} = props;
3437

3538
let triggerRef = useRef<HTMLLIElement>(null);
@@ -119,5 +122,5 @@ ContextualHelpTrigger.getCollectionNode = function* getCollectionNode<T>(props:
119122
};
120123
};
121124

122-
let _Item = ContextualHelpTrigger as <T>(props: SpectrumMenuDialogTriggerProps<T>) => JSX.Element;
125+
let _Item = ContextualHelpTrigger as (props: SpectrumMenuDialogTriggerProps) => JSX.Element;
123126
export {_Item as ContextualHelpTrigger};

0 commit comments

Comments
 (0)