Skip to content

fix: reduce CustomTooltip delays to eliminate sluggishness#1691

Open
shashank-tomar0 wants to merge 1 commit into
layer5io:masterfrom
shashank-tomar0:fix/customtooltip-delays
Open

fix: reduce CustomTooltip delays to eliminate sluggishness#1691
shashank-tomar0 wants to merge 1 commit into
layer5io:masterfrom
shashank-tomar0:fix/customtooltip-delays

Conversation

@shashank-tomar0

Copy link
Copy Markdown

Description
Reduces the hardcoded enter/leave delays in CustomTooltip that cause sluggish tooltip behavior.

Changes

  • enterDelay: 150100 (configurable via props, default 100)
  • leaveDelay: 7000 (configurable via props, default 0) — this was the main cause of sluggishness
  • Removed enterNextDelay={400} (unnecessary with leaveDelay=0)
  • All delay values are now overridable by callers via props

Related
Companion PR in meshery/meshery: adds theme-level MuiTooltip.defaultProps for direct Tooltip usages not using CustomTooltip.

Copilot AI review requested due to automatic review settings July 7, 2026 12:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request makes the enterDelay and leaveDelay props configurable in CustomTooltip, defaulting them to 100 and 0 respectively. The review feedback correctly points out that a default leaveDelay of 0 will break interactive tooltips by closing them instantly before a user can hover over the tooltip content. It is recommended to conditionally set leaveDelay based on the interactive prop.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +30 to +39
enterDelay = 100,
leaveDelay = 0,
...props
}: CustomTooltipProps): JSX.Element {
const theme = useTheme();

return (
<Tooltip
enterDelay={150}
enterNextDelay={400}
leaveDelay={700}
enterDelay={enterDelay}
leaveDelay={leaveDelay}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

When interactive is set to true on a tooltip, the user needs a brief window of time to move the mouse cursor from the anchor element to the tooltip content itself. Setting the default leaveDelay to 0 will cause the tooltip to close instantly as soon as the mouse leaves the anchor, making it impossible for users to interact with any content inside the tooltip (such as links or buttons).

To prevent this usability and accessibility issue, we should conditionally set the default leaveDelay based on whether interactive is enabled (e.g., defaulting to 300ms when interactive is true, and 0 otherwise).

  interactive,
  enterDelay = 100,
  leaveDelay = interactive ? 300 : 0,
  ...props
}: CustomTooltipProps): JSX.Element {
  const theme = useTheme();

  return (
    <Tooltip
      interactive={interactive}
      enterDelay={enterDelay}
      leaveDelay={leaveDelay}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants