diff --git a/changelogs/upcoming/7489.md b/changelogs/upcoming/7489.md new file mode 100644 index 00000000000..7239dc5212d --- /dev/null +++ b/changelogs/upcoming/7489.md @@ -0,0 +1,3 @@ +**Breaking changes** + +- Removed deprecated `toolTipTitle` and `toolTipPosition` props from `EuiContextMenuItem`. Use `toolTipProps.title` and `toolTilProps.position` instead diff --git a/src-docs/src/views/context_menu/context_menu.js b/src-docs/src/views/context_menu/context_menu.js index b6460eb09e8..bd4ea422341 100644 --- a/src-docs/src/views/context_menu/context_menu.js +++ b/src-docs/src/views/context_menu/context_menu.js @@ -59,9 +59,11 @@ export default () => { { name: 'Add a tooltip', icon: 'document', - toolTipTitle: 'Optional tooltip', toolTipContent: 'Optional content for a tooltip', - toolTipPosition: 'right', + toolTipProps: { + title: 'Optional tooltip title', + position: 'right', + }, onClick: closePopover, }, { @@ -78,7 +80,7 @@ export default () => { name: 'Disabled option', icon: 'user', toolTipContent: 'For reasons, this item is disabled', - toolTipPosition: 'right', + toolTipProps: { position: 'right' }, disabled: true, onClick: closePopover, }, diff --git a/src/components/context_menu/context_menu.stories.tsx b/src/components/context_menu/context_menu.stories.tsx index 146ef8e2599..42f09762317 100644 --- a/src/components/context_menu/context_menu.stories.tsx +++ b/src/components/context_menu/context_menu.stories.tsx @@ -53,9 +53,11 @@ const panels: EuiContextMenuProps['panels'] = [ { name: 'Add a tooltip', icon: 'document', - toolTipTitle: 'Optional tooltip', toolTipContent: 'Optional content for a tooltip', - toolTipPosition: 'right', + toolTipProps: { + title: 'Optional tooltip title', + position: 'right', + }, onClick: noop, }, { @@ -72,7 +74,7 @@ const panels: EuiContextMenuProps['panels'] = [ name: 'Disabled option', icon: 'user', toolTipContent: 'For reasons, this item is disabled', - toolTipPosition: 'right', + toolTipProps: { position: 'right' }, disabled: true, onClick: noop, }, diff --git a/src/components/context_menu/context_menu.tsx b/src/components/context_menu/context_menu.tsx index 68faaa8a1f8..b1f99bb35c0 100644 --- a/src/components/context_menu/context_menu.tsx +++ b/src/components/context_menu/context_menu.tsx @@ -318,16 +318,7 @@ export class EuiContextMenuClass extends Component< return ; } - const { - panel, - name, - key, - icon, - onClick, - toolTipTitle, - toolTipContent, - ...rest - } = item; + const { panel, name, key, icon, onClick, ...rest } = item; const onClickHandler = panel ? (event: React.MouseEvent) => { @@ -351,8 +342,6 @@ export class EuiContextMenuClass extends Component< icon={icon} onClick={onClickHandler} hasPanel={Boolean(panel)} - toolTipTitle={toolTipTitle} - toolTipContent={toolTipContent} {...rest} > {name} diff --git a/src/components/context_menu/context_menu_item.test.tsx b/src/components/context_menu/context_menu_item.test.tsx index 8c26344cfcc..418c3ededef 100644 --- a/src/components/context_menu/context_menu_item.test.tsx +++ b/src/components/context_menu/context_menu_item.test.tsx @@ -138,8 +138,6 @@ describe('EuiContextMenuItem', () => { const { getByRole, baseElement } = render( Hello diff --git a/src/components/context_menu/context_menu_item.tsx b/src/components/context_menu/context_menu_item.tsx index 390ae73f560..c87c3f75f6f 100644 --- a/src/components/context_menu/context_menu_item.tsx +++ b/src/components/context_menu/context_menu_item.tsx @@ -26,7 +26,7 @@ import { import { validateHref } from '../../services/security/href_validator'; import { CommonProps, keysOf } from '../common'; import { EuiIcon } from '../icon'; -import { EuiToolTip, EuiToolTipProps, ToolTipPositions } from '../tool_tip'; +import { EuiToolTip, EuiToolTipProps } from '../tool_tip'; import { euiContextMenuItemStyles } from './context_menu_item.styles'; @@ -53,14 +53,6 @@ export interface EuiContextMenuItemProps * Accepts any prop that EuiToolTip does, except for `content` and `children`. */ toolTipProps?: Partial>; - /** - * @deprecated Use toolTipProps.title instead - */ - toolTipTitle?: ReactNode; - /** - * @deprecated Use tooltipProps.position instead - */ - toolTipPosition?: ToolTipPositions; href?: string; target?: string; rel?: string; @@ -99,9 +91,7 @@ export const EuiContextMenuItem: FunctionComponent = ({ buttonRef, disabled: _disabled, layoutAlign = 'center', - toolTipTitle, toolTipContent, - toolTipPosition = 'right', toolTipProps, href, target, @@ -215,8 +205,7 @@ export const EuiContextMenuItem: FunctionComponent = ({ ); return (