mantine: Uncontrolled tooltips don't appear in Chromium-based browsers when pointerType is 'pointer'
What package has an issue
Describe the bug
At least on the machines I have available to test with, uncontrolled tooltips generally will not appear at all - but rarely will appear for the first hover and then never again. Affects X11 and Wayland.
First discovered this on 5.2.7.
What version of @mantine/hooks page do you have in package.json?
5.4.1
If possible, please include a link to a codesandbox with the reproduced problem
https://codesandbox.io/s/amazing-blackburn-ms245w?file=/src/App.tsx
To reproduce: Hover the text “hello” with a Chromium browser on a Linux machine - no tooltip will appear
Issue occurs on: Ubuntu 22.04 and Linux Mint 20.2 Works properly on: Windows 7 and macOS 12.4
Do you know how to fix the issue
No
Are you willing to participate in fixing this issue and create a pull request with the fix
Yes
Possible fix
Unknown
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 46 (31 by maintainers)
There should not be any issues, I’ll update the package to the latest version in 5.10
Yes, I also changed the package name just then to
@floating-ui/react(for a couple reasons) but it has the fixes in. It should be straightforward to upgrade to that package in Mantine@Slapbox Thanks a lot for the investigation.
If you mean
pointerType, Mine ishand.pointerTypecan behand😓 ?! Maintaining a library is hard, magical values can appear out of nowhere 😄@nmay231 No. It’s just a pure Ubuntu install on hardware.
@nmay231
Okay, I still cannot reproduce the issue in Chrome on macos and Windows, so I cannot do much about it
@Slapbox Sure thing.
Doesn’t look like
Multiple Raster Threads: Enabledis the issue, unfortunately.@picobyte that doesn’t sound like the same issue, and I apologize for not properly updating the title and closing this. I do believe this is resolved via an upgrade of the
floating-uidependency.In my case it was not Linux per se, but the fact that
pointerTypewaspointerrather thanmouse. In my case nothing showed, but it sounds like something is showing for you.I’d advise opening a new issue, or otherwise updating the details here to show that this issue isn’t fixed. I will close this issue for now (as I should have long ago) because I believe this is fixed.
So we just need a PR upgrading
@floating-ui/react-dom-interactionsto resolve the issue on Mantine’s side?Does this happen on my Sandbox (upgraded to 0.13.3)?
Ok good, we’ve corrected this already in 0.13.3, so the issue should be fixed without needing anything else changed
Yeah I do think it needs to be renamed as a result. I try to keep breaking changes to a minimum, but sometimes unavoidable :\
@Slapbox I think the best way would be to convert your PR to just check for
!== 'touch'. That will handle a myriad of cases we can’t possibly predict, while removing hover for touch which is really the main goal.@rtivital @nmay231 here’s a sandbox using the example from Floating UI’s tooltip page. It works on all machines, problem or not. I think there must be some implementation issue present in the Mantine configuration that isn’t present in this minimal example: https://codesandbox.io/s/wizardly-wildflower-tl3bh0?file=/src/App.js
This is basically just a copy/paste of the code from https://floating-ui.com/docs/tooltip#usefloating-hook (but piecemeal because they don’t have all of the relevant code shown in a single codeblock) - except I disabled the line
whileElementsMounted: autoUpdateto be closer to Mantine’s implementation.With Mantine, when I set
useFloatingto rely directly on the outputs ofuseState(like below,) it didn’t fix the problem, so I think there’s some other issue in the Mantine code, which somehow is only affecting Linux. I wonder if this points to a problem inTooltip.jsor inuse-tooltip.js, or elsewhere.The
floating-uipackage in the repro is newer than in Mantine, but I forced Mantine to use the newest version in our project and it made no difference in the problem, so I don’t think it has anything to do with Floating UI version.Here’s what did not work to fix the issue
So we can also rule out that it has anything to do with the
useCallbackhere: https://github.com/mantinedev/mantine/blob/539c6c6e9f078467f7037d7314926c10b040b4c1/src/mantine-core/src/Tooltip/use-tooltip.ts#L44-L53I know it’s not much help, but I can confirm that the
4.2.12is unaffected on the problem machine: https://codesandbox.io/s/hardcore-carlos-l62fk5I changed the code in
useTooltip.jsand found that_openedis indeed alwaysfalseon any problem machine.https://github.com/mantinedev/mantine/blob/539c6c6e9f078467f7037d7314926c10b040b4c1/src/mantine-core/src/Tooltip/use-tooltip.ts#L44-L53
What I noted: Every time the tooltip is hovered, nothing is printed. When the mouse leaves the tooltip target, then it prints
{_opened: false}.Tooltips can be made to appear on the problem machines: In the debugger, pause at this line and then call
setUncontrolledOpened(true).I can confirm. None of the examples in the link below are working on the Linux Chrome browser.
https://mantine.dev/core/tooltip/
But they are working fine on Firefox.
No, still no idea
Thanks for testing @nmay231. Unfortunately it’s definitely not due to any extension as I’m able to reproduce it in Chrome and in Electron, but maybe it’s something related to GPU rendering on Linux?
I’ve been trying to test on a third machine but haven’t been able to get a Chromium browser installed yet due to some dumb bug in Manjaro.
I’ll update with further findings as I can.
@Slapbox Your sandbox works fine for me on Ubuntu 22.04 (Wayland I think?) with Chrome 104.0.5112.101. I have tried hovering/unhovering multiple times, switching focus between tabs and windows then trying again, and hovering while focused on another window.
Try opening an incognito window to see if an extension is causing the problem or something.