Skip to content

Commit

Permalink
fix(ui): sticky preset image tooltip
Browse files Browse the repository at this point in the history
There's a bug where preset image tooltips get stuck open in the list.

After much fiddling, debugging, and review of upstream dependencies, I have determined that this is bug in Chakra-UI v2.

Specifically, it appears to be a race condition related to the Tooltip component's internal use of the `useDisclosure` hook to manage tooltip open state, and the react render cycle.

Unfortunately, Chakra v2 is no longer being updated, and it's a pain in the butt to vendor and fix that component given its dependencies. Not 100% sure I could easily fix it, anyways.

Fortunately, there is a workaround - reduce the tooltip openDelay to 0ms. I prefer the current 500ms delay but I think it's preferable to have too-quick tooltips than too-sticky tooltips...
  • Loading branch information
psychedelicious committed Jan 9, 2025
1 parent 8da9d3b commit bdb00a0
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const StylePresetImage = ({ presetImageUrl, imageWidth }: { presetImageUrl: stri
return (
<Tooltip
closeOnScroll
openDelay={0}
label={
presetImageUrl && (
<Image
Expand Down

0 comments on commit bdb00a0

Please sign in to comment.