mantinedev / mantine

A fully featured React components library
https://mantine.dev
MIT License
26.79k stars 1.9k forks source link

useHover hover property does not work during conditional rendering #6908

Closed starxyn closed 1 month ago

starxyn commented 1 month ago

Dependencies check up

What version of @mantine/* packages do you have in package.json?

7.13.0

What package has an issue?

@mantine/hooks

What framework do you use?

Vite

In which browsers you can reproduce the issue?

Chrome

Describe the bug

useHover not working

As can be seen from the gif above, the Carnival is supposed to render a balloon overlay out (ignore the problem where the balloon is clearly not being overlayed first) after hovering on it. it works for the start until I click the button to hide the carnival and when I hover it once again, the balloon cannot be rendered. I have also recorded down the console logs of hovered state. Clearly after the button is clicked, the isHovered state is always false.

In my codesandbox, there is conditional rendering imposed on the group to control whether the carnival can be seen. Is the conditional rendering causing the issue? If so, how should I make the balloon shows up on hover once again?

If possible, include a link to a codesandbox with a minimal reproduction

https://codesandbox.io/p/sandbox/5w5g4w

Possible fix

No response

Self-service

rtivital commented 1 month ago

Fixed by #6782, will be available with the 7.13.1 patch

starxyn commented 1 month ago

I see. Thanks!

rtivital commented 1 month ago

Fixed in 7.13.1