Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltip not closing - mouseEvent not fired #186

Open
1 task done
gschlader101 opened this issue Nov 2, 2023 · 3 comments
Open
1 task done

Tooltip not closing - mouseEvent not fired #186

gschlader101 opened this issue Nov 2, 2023 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed V1 Issue with MRT V1

Comments

@gschlader101
Copy link

mantine-react-table version

v1.3.3

react & react-dom versions

v18.2.0

Describe the bug and the steps to reproduce it

The Tooltip for the Column sort button in the table head does not close. (applies also to search, column density..)

It is reproduceable actually on the Mantine React Table demo site as well, as seen in the screenshot below where the mouse pointer is hovering a row and the sorting tooltip is still there.

To reproduce it, you have to move the mouse pointer away quickly downwards after the click on the button.

Chain of events, what I suspect is happening:

  1. Icon is hovered --> Tooltip appears

  2. Icon is clicked --> Sorting order Label changes --> Tooltip stays
    If now the mouse pointer is pulled away during the rerender, the Tooltip will stay permanently.

  3. If the mouse pointer is moved away after the rerender is completed --> Tooltip goes away

I believe the way to improve it, would be to make the Tooltip disappear in the onclick event.

You guys are doing an amazing job !

image

Minimal, Reproducible Example - (Optional, but Recommended)

can be reproduced here for example, probably it gets easier to reproduce if table is a bit larger and rerender takes longer.

https://www.mantine-react-table.com/docs/guides/column-ordering-dnd

Screenshots or Videos (Optional)

image
image

Do you intend to try to help solve this bug with your own PR?

Maybe, I'll investigate and start debugging

Terms

  • I understand that if my bug cannot be reliably reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
@gschlader101
Copy link
Author

here are some more clarifications:

The underlying library for the Tooltip is mantine/core and that uses Floating UI.

The onOpenChange event is not fired in the scenario described above because it's lost during rerender
as it is uncontrolled.

The open state change is "correct" , but the onCange event is not fired.

So it's not really a bug in the MRT, but I think the behavior could be improved by:

  • having a prop enableToolbarTooltip
  • close the Tooltip on the onClick event, when an icon is clicked

@alessandrojcm alessandrojcm added the V1 Issue with MRT V1 label Dec 9, 2023
@alessandrojcm alessandrojcm added enhancement New feature or request help wanted Extra attention is needed labels Jan 3, 2024
@KevinVandy
Copy link
Owner

I've already solved this with managed state for the full screen button. Didn't realize that the sort tooltips needed this too

@Dalimil
Copy link
Contributor

Dalimil commented Feb 9, 2024

We are experiencing the same issue. Since columns keep changing widths, clicking sort asc/desc on the column header can cause column width to change and the tooltip stays open forever, not registering the mouse event that should close it.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed V1 Issue with MRT V1
Projects
None yet
Development

No branches or pull requests

4 participants