fix: reduce CustomTooltip delays to eliminate sluggishness#1691
fix: reduce CustomTooltip delays to eliminate sluggishness#1691shashank-tomar0 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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.
| enterDelay = 100, | ||
| leaveDelay = 0, | ||
| ...props | ||
| }: CustomTooltipProps): JSX.Element { | ||
| const theme = useTheme(); | ||
|
|
||
| return ( | ||
| <Tooltip | ||
| enterDelay={150} | ||
| enterNextDelay={400} | ||
| leaveDelay={700} | ||
| enterDelay={enterDelay} | ||
| leaveDelay={leaveDelay} |
There was a problem hiding this comment.
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}
Description
Reduces the hardcoded enter/leave delays in
CustomTooltipthat cause sluggish tooltip behavior.Changes
enterDelay:150→100(configurable via props, default100)leaveDelay:700→0(configurable via props, default0) — this was the main cause of sluggishnessenterNextDelay={400}(unnecessary withleaveDelay=0)Related
Companion PR in meshery/meshery: adds theme-level
MuiTooltip.defaultPropsfor directTooltipusages not usingCustomTooltip.