react-tooltip icon indicating copy to clipboard operation
react-tooltip copied to clipboard

resolve --rt-transition-show-delay closer to tooltip for js timer

Open RickeyWard opened this issue 3 months ago • 3 comments

Changing --rt-transition-show-delay anywhere except in head or on body were not be picked up by show/hide timeouts causing out animations to be skipped entirely by removing the tooltip from the DOM when not using default positioned styles. This change evaluates the variable on the tooltip its self so that the property can be honored lower in the tree, which is already is for the animations, just not for the js timers.

Motivation: Using in a project intended to be embedded in other GUIs that should not modify the the DOM outside of its parent. I can't find a compelling reason why this computed style needs to be pinned to the document.body scope.

note: Either the naming of these variables are confusing or its possibly just using the wrong css variable here, --rt-transition-show-delay is used to delay unmounting when hiding and also to control the length of the default fade-in animation. It appears that this should really use --rt-transition-closing-delay as that's what dictates the length of the fade out duration. being new to the codebase I didn't want to make any assumptions but I'd be happy to change this as part of this PR if desired.

Summary by CodeRabbit

  • Bug Fixes
    • Tooltip animations now respect each tooltip’s own transition delay settings, ensuring consistent and predictable show/hide timing.
    • Resolves cases where custom theme or per-tooltip CSS variables were ignored, which could cause unexpected delays.
    • Improves visual consistency across different tooltips without changing overall behavior.

RickeyWard avatar Aug 30 '25 13:08 RickeyWard