Skip to content
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8e31eb5
refactor(side-navigation): remove useTooltip utility
weronikaolejniczak Apr 30, 2026
44b033e
refactor: remove onMouseOut hide tooltip workarounds
weronikaolejniczak Apr 30, 2026
979c9da
chore: fix TypeScript errors
weronikaolejniczak Apr 30, 2026
15443e1
chore: update snapshots after refactor
weronikaolejniczak May 4, 2026
cf77bf0
chore(side-navigation): remove redundant tooltip tests
weronikaolejniczak May 4, 2026
19434b5
feat: remove delay from tooltips
weronikaolejniczak May 4, 2026
e00d7f2
chore: remove tooltip helpers
weronikaolejniczak May 4, 2026
c1f461e
chore: update delay snapshots
weronikaolejniczak May 4, 2026
d3a68d5
chore: get hidden tooltip
weronikaolejniczak May 4, 2026
5157f0f
chore: update failing Jest tests
weronikaolejniczak May 5, 2026
8bbf50a
chore: assert text in document instead of getting by role
weronikaolejniczak May 5, 2026
9fb2691
chore: update EUI packages
weronikaolejniczak May 6, 2026
b6006b8
TO FIX: Run node 'scripts/yarn_deduplicate && yarn kbn bootstrap' loc…
kibanamachine May 6, 2026
6ed03f0
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine May 6, 2026
fd0770f
chore: remove delay="long"
weronikaolejniczak May 6, 2026
8ac94cc
chore: update failing tests
weronikaolejniczak May 6, 2026
9a1fb52
chore: update rule_snoozing test
weronikaolejniczak May 6, 2026
219987c
Merge branch 'main' into test/tooltip-focus
weronikaolejniczak May 7, 2026
e1a0112
feat: remove delay prop
weronikaolejniczak May 7, 2026
2ff2c5f
Merge branch 'main' into test/tooltip-focus
weronikaolejniczak May 7, 2026
e2ef93d
Merge branch 'main' into test/tooltip-focus
weronikaolejniczak May 7, 2026
db24510
Merge branch 'main' into test/tooltip-focus
weronikaolejniczak May 7, 2026
85d589c
Merge branch 'main' into test/tooltip-focus
weronikaolejniczak May 7, 2026
7f0783c
Merge branch 'main' into test/tooltip-focus
weronikaolejniczak May 7, 2026
426aeee
chore: use realHover in rule_snoozing Cypress suite
weronikaolejniczak May 7, 2026
674918d
Merge branch 'main' into test/tooltip-focus
weronikaolejniczak May 7, 2026
26479c0
Merge branch 'main' into test/tooltip-focus
weronikaolejniczak May 7, 2026
ee2f225
chore: fix rule_snoozing (finally) by waiting
weronikaolejniczak May 8, 2026
10f0b70
Merge branch 'main' into test/tooltip-focus
weronikaolejniczak May 8, 2026
69ff1b8
chore: retry before realHover
weronikaolejniczak May 8, 2026
f07386f
Merge branch 'main' into test/tooltip-focus
weronikaolejniczak May 8, 2026
36efc8e
chore: update rule_snoozing selector
weronikaolejniczak May 8, 2026
0530c82
Merge branch 'main' into test/tooltip-focus
weronikaolejniczak May 9, 2026
0c2ccb4
chore: update rule_snoozing selector
weronikaolejniczak May 9, 2026
f296a51
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine May 9, 2026
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
7 changes: 1 addition & 6 deletions examples/user_profile_examples/public/tooltip_demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@ export const ToolTipDemo: FunctionComponent = () => {
<UserAvatarTip user={userProfile.user} avatar={userProfile.data.avatar} />
}
username={
<UserToolTip
position="top"
delay="regular"
user={userProfile.user}
avatar={userProfile.data.avatar}
>
<UserToolTip position="top" user={userProfile.user} avatar={userProfile.data.avatar}>
<strong>{userProfile.user.full_name}</strong>
</UserToolTip>
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"@elastic/elasticsearch": "9.3.4",
"@elastic/ems-client": "8.7.0",
"@elastic/esql": "3.0.0",
"@elastic/eui": "114.3.0",
"@elastic/eui": "115.0.0",
"@elastic/eui-theme-borealis": "7.0.0",
"@elastic/filesaver": "1.1.2",
"@elastic/kibana-d3-color": "npm:@elastic/kibana-d3-color@2.0.1",
Expand Down Expand Up @@ -1603,7 +1603,7 @@
"@cypress/debugging-proxy": "2.0.1",
"@cypress/grep": "5.1.0",
"@cypress/webpack-preprocessor": "6.0.2",
"@elastic/eslint-plugin-eui": "2.11.1",
"@elastic/eslint-plugin-eui": "2.12.0",
"@elastic/makelogs": "6.1.1",
"@emotion/babel-preset-css-prop": "11.11.0",
"@emotion/jest": "11.11.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export const AppMenuActionButton = (props: AppMenuActionButtonProps) => {
*/
const button =
showTooltip && !hasSplitItems ? (
<EuiToolTip content={content} title={title} delay="long">
<EuiToolTip content={content} title={title}>
{buttonComponent}
</EuiToolTip>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const AppMenuItem = ({
*/
const button =
showTooltip && !hasItems ? (
<EuiToolTip content={content} title={title} delay="long">
<EuiToolTip content={content} title={title}>
{buttonComponent}
</EuiToolTip>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const AppMenuPopover = ({
const showTooltip = Boolean(content || title);

const button = showTooltip ? (
<EuiToolTip delay="long" content={content} title={title}>
<EuiToolTip content={content} title={title}>
{anchorElement}
</EuiToolTip>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -787,38 +787,6 @@ describe('Both modes', () => {
expect(integrationsLink).toHaveAttribute('data-highlighted', 'true');
});

/**
* GIVEN there are footer items
* WHEN I hover over a footer item
* THEN a tooltip appears with the item label
* AND when I click on the trigger
* AND then I hover out
* THEN the tooltip disappears
*/
it('should display a tooltip with the item label on hover, and hide on hover out', async () => {
render(<TestComponent items={basicMock.navItems} logo={basicMock.logo} />);

const developerToolsLink = screen.getByTestId(footerItemId('developer_tools'));

await user.hover(developerToolsLink);
flushPopoverTimers();

const tooltip = await screen.findByRole('tooltip', {
name: 'Developer tools',
});

expect(tooltip).toBeInTheDocument();

await user.click(developerToolsLink);
await user.unhover(developerToolsLink);

// Even after clicking on the trigger which makes the `EuiToolTip` persistent by default
// See: https://eui.elastic.co/docs/components/display/tooltip/
await waitFor(() => {
expect(tooltip).not.toBeInTheDocument();
});
});

it('should switch popover when hovering from one item to another', async () => {
const customNavItems = {
...basicMock.navItems,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,38 +77,6 @@ describe('Collapsed mode', () => {
// See: https://eui.elastic.co/docs/utilities/accessibility/#screen-reader-only
expect(solutionLogo.children[1].className).toContain('euiScreenReaderOnly');
});

/**
* GIVEN the side navigation is in collapsed mode
* WHEN I hover over the solution logo
* THEN a tooltip appears with the item label
* AND when I click on the trigger
* AND then I hover out
* THEN the tooltip disappears
*/
it('should display a tooltip with the solution label on hover, and hide on hover out', async () => {
render(<TestComponent isCollapsed items={basicMock.navItems} logo={basicMock.logo} />);

const solutionLogo = screen.getByTestId(logoId);

await user.hover(solutionLogo);
flushPopoverTimers();

const tooltip = await screen.findByRole('tooltip', {
name: 'Solution',
});

expect(tooltip).toBeInTheDocument();

await user.click(solutionLogo);
await user.unhover(solutionLogo);

// Even after clicking on the trigger which makes the `EuiToolTip` persistent by default
// See: https://eui.elastic.co/docs/components/display/tooltip/
await waitFor(() => {
expect(tooltip).not.toBeInTheDocument();
});
});
});

describe('Primary menu', () => {
Expand Down Expand Up @@ -262,38 +230,6 @@ describe('Collapsed mode', () => {
expect(dashboardsLink).toHaveAttribute('href', expectedHref);
});

/**
* GIVEN the side navigation is in collapsed mode
* WHEN I hover over a primary menu item
* THEN a tooltip appears with the item label
* AND when I click on the trigger
* AND then I hover out
* THEN the tooltip disappears
*/
it('should display a tooltip with the item label on hover, and hide on hover out', async () => {
render(<TestComponent isCollapsed items={basicMock.navItems} logo={basicMock.logo} />);

const dashboardsLink = screen.getByTestId(primaryItemId('dashboards'));

await user.hover(dashboardsLink);
flushPopoverTimers();

const tooltip = await screen.findByRole('tooltip', {
name: 'Dashboards',
});

expect(tooltip).toBeInTheDocument();

await user.click(dashboardsLink);
await user.unhover(dashboardsLink);

// Even after clicking on the trigger which makes the `EuiToolTip` persistent by default
// See: https://eui.elastic.co/docs/components/display/tooltip/
await waitFor(() => {
expect(tooltip).not.toBeInTheDocument();
});
});

/**
* GIVEN the side navigation is in collapsed mode
* AND a primary menu item is in beta
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { BetaBadge } from '../beta_badge';
import { NAVIGATION_SELECTOR_PREFIX, TOOLTIP_OFFSET } from '../../constants';
import { focusMainContent } from '../../utils/focus_main_content';
import { useHighContrastModeStyles } from '../../hooks/use_high_contrast_mode_styles';
import { useTooltip } from '../../hooks/use_tooltip';
import { NewItemIndicator } from '../new_item_indicator';

export interface FooterItemProps extends Omit<EuiButtonIconProps, 'iconType'>, MenuItem {
Expand All @@ -43,7 +42,6 @@ export const FooterItem = forwardRef<HTMLAnchorElement, FooterItemProps>(
ref: ForwardedRef<HTMLAnchorElement>
) => {
const { euiTheme } = useEuiTheme();
const { tooltipRef, handleMouseOut } = useTooltip();
const highContrastModeStyles = useHighContrastModeStyles();

const handleFooterItemKeyDown = (e: KeyboardEvent) => {
Expand Down Expand Up @@ -125,9 +123,7 @@ export const FooterItem = forwardRef<HTMLAnchorElement, FooterItemProps>(
}}
content={tooltipContent}
disableScreenReaderOutput
onMouseOut={handleMouseOut}
position="right"
ref={tooltipRef}
repositionOnScroll
offset={TOOLTIP_OFFSET}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import type { MenuItem } from '../../../types';
import { BetaBadge } from '../beta_badge';
import { MenuItem as MenuItemComponent } from '../menu_item';
import { NAVIGATION_SELECTOR_PREFIX, TOOLTIP_OFFSET } from '../../constants';
import { useTooltip } from '../../hooks/use_tooltip';

export interface PrimaryMenuItemProps extends Omit<MenuItem, 'href'> {
as?: 'a' | 'button';
Expand Down Expand Up @@ -57,7 +56,6 @@ export const PrimaryMenuItem = forwardRef<
ref: ForwardedRef<HTMLAnchorElement | HTMLButtonElement>
): JSX.Element => {
const { euiTheme } = useEuiTheme();
const { tooltipRef, handleMouseOut } = useTooltip();

const wrapperStyles = css`
display: flex;
Expand Down Expand Up @@ -110,11 +108,9 @@ export const PrimaryMenuItem = forwardRef<
if (tooltipContent) {
return (
<EuiToolTip
ref={tooltipRef}
anchorProps={{ css: wrapperStyles }}
content={tooltipContent}
disableScreenReaderOutput
onMouseOut={handleMouseOut}
position="right"
repositionOnScroll
offset={TOOLTIP_OFFSET}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { i18n } from '@kbn/i18n';
import type { SideNavLogo } from '../../../types';
import { MenuItem } from '../menu_item';
import { NAVIGATION_SELECTOR_PREFIX } from '../../constants';
import { useTooltip } from '../../hooks/use_tooltip';
import { getHighContrastSeparator } from '../../hooks/use_high_contrast_mode_styles';

export interface LogoProps extends Omit<HTMLAttributes<HTMLAnchorElement>, 'onClick'>, SideNavLogo {
Expand All @@ -36,7 +35,6 @@ export const Logo = ({
}: LogoProps): JSX.Element => {
const euiThemeContext = useEuiTheme();
const { euiTheme } = euiThemeContext;
const { tooltipRef, handleMouseOut } = useTooltip();

/**
* **Icon size**
Expand Down Expand Up @@ -90,14 +88,7 @@ export const Logo = ({

if (isCollapsed) {
return (
<EuiToolTip
ref={tooltipRef}
content={label}
disableScreenReaderOutput
onMouseOut={handleMouseOut}
position="right"
repositionOnScroll
>
<EuiToolTip content={label} disableScreenReaderOutput position="right" repositionOnScroll>
{menuItem}
</EuiToolTip>
);
Expand Down

This file was deleted.

32 changes: 0 additions & 32 deletions src/platform/kbn-ui/side-navigation/src/hooks/use_tooltip.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function KeyboardShortcuts() {
anchorPosition="downRight"
panelPaddingSize="none"
button={
<EuiToolTip content={label} delay="long" disableScreenReaderOutput>
<EuiToolTip content={label} disableScreenReaderOutput>
<EuiButtonIcon
size="xs"
iconType="keyboard"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const TooltipWrapper: React.FunctionComponent<TooltipWrapperProps> = ({
return (
<>
{condition ? (
<EuiToolTip content={tooltipContent} delay="regular" {...tooltipProps}>
<EuiToolTip content={tooltipContent} {...tooltipProps}>
<>{children}</>
</EuiToolTip>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
@elastic/esql@3.0.0
@elastic/eui-theme-borealis@7.0.0
@elastic/eui-theme-common@9.0.0
@elastic/eui@114.3.0
@elastic/eui@115.0.0
@elastic/numeral@2.5.1
@elastic/prismjs-esql@1.1.2
@emotion/babel-plugin@11.13.5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ export function ColorRangesExtraActions({
)}
condition={shouldDisableAdd}
position="top"
delay="regular"
>
<EuiButtonEmpty
data-test-subj={`lnsPalettePanel_dynamicColoring_addColor`}
Expand All @@ -90,7 +89,6 @@ export function ColorRangesExtraActions({
tooltipContent={oneColorRangeWarn}
condition={shouldDisableReverse}
position="top"
delay="regular"
>
<EuiButtonEmpty
data-test-subj={`lnsPalettePanel_dynamicColoring_reverseColors`}
Expand All @@ -116,7 +114,6 @@ export function ColorRangesExtraActions({
tooltipContent={oneColorRangeWarn}
condition={shouldDisableDistribute}
position="top"
delay="regular"
>
<EuiButtonEmpty
data-test-subj={`lnsPalettePanel_dynamicColoring_distributeValues`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function ColorRangeEditButton({
}

return (
<TooltipWrapper tooltipContent={tooltipContent} condition={true} position="top" delay="regular">
<TooltipWrapper tooltipContent={tooltipContent} condition={true} position="top">
<EuiButtonIcon
iconType="pencil"
aria-label={tooltipContent}
Expand Down Expand Up @@ -136,7 +136,7 @@ export function ColorRangeAutoDetectButton({
}, [continuity, dataBounds, dispatch, isLast, palettes]);

return (
<TooltipWrapper tooltipContent={tooltipContent} condition={true} position="top" delay="regular">
<TooltipWrapper tooltipContent={tooltipContent} condition={true} position="top">
<EuiButtonIcon
iconType={iconFactory}
aria-label={tooltipContent}
Expand Down
Loading
Loading