mantinedev / mantine

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

Controlled Tooltip is flickering on iOS #5237

Closed kandabi-zorro closed 11 months ago

kandabi-zorro commented 11 months ago

What package has an issue?

@mantine/core

Describe the bug

Tooltip component does not open immediately upon first click on iOS when using controlled state. This only happens on mobile safari iOS, the uncontrolled events work as expected.

What version of @mantine/ packages do you have in package.json? (Note that all @mantine/ packages must have the same version in order to work correctly)

@mantine/core 7.2.1 @mantine/hooks 7.2.1

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

https://codesandbox.io/s/compassionate-meadow-n5k242?file=/src/App.js

Do you know how to fix the issue

No

Do you want to send a pull request with a fix?

No

Possible fix

No response

rtivital commented 11 months ago

If you set opened prop on Tooltip component, you get full control over the opened state. If the tooltip behavior is unexpected, it means that you've used incorrect events. You can find uncontrolled tooltip logic here – https://github.com/floating-ui/floating-ui/blob/master/packages/react/src/hooks/useHover.ts