Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion packages/react-core/src/components/Dropdown/DropdownItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ export interface DropdownItemProps extends Omit<MenuItemProps, 'ref'>, OUIAProps
className?: string;
/** Description of the dropdown item */
description?: React.ReactNode;
/** Render item as disabled option */
isDisabled?: boolean;
/** Identifies the component in the dropdown onSelect callback */
itemId?: any;
/** Callback for item click */
onClick?: (event?: any) => void;
/** Value to overwrite the randomly generated data-ouia-component-id.*/
ouiaId?: number | string;
/** Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false. */
Expand All @@ -22,14 +26,24 @@ export const DropdownItem: React.FunctionComponent<MenuItemProps> = ({
children,
className,
description,
isDisabled,
itemId,
onClick,
ouiaId,
ouiaSafe,
...props
}: DropdownItemProps) => {
const ouiaProps = useOUIAProps(DropdownItem.displayName, ouiaId, ouiaSafe);
return (
<MenuItem className={css(className)} description={description} itemId={itemId} {...ouiaProps} {...props}>
<MenuItem
className={css(className)}
description={description}
isDisabled={isDisabled}
itemId={itemId}
onClick={onClick}
{...ouiaProps}
{...props}
>
{children}
</MenuItem>
);
Expand Down