Skip to content

Trigger Tooltip on disabled elements #479

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

Merged
merged 3 commits into from
Aug 18, 2020

Conversation

pomfrida
Copy link
Collaborator

Mouse Events on disabled elements are buggy.

This is a known issue on Safari and Chrome browsers. Testing in Firefox gives us the desired outcome.

Trying to find a workaround that goes for all browsers...

@pomfrida pomfrida self-assigned this Aug 10, 2020
@pomfrida pomfrida linked an issue Aug 10, 2020 that may be closed by this pull request
@pomfrida
Copy link
Collaborator Author

pomfrida commented Aug 10, 2020

Could solve it with CSS on the disabled element: pointer-events: none;
But this will override that beautiful forbidden cursor... Hmm...

disabled element, shown in the example below. This will help trigger
the mouse events correctly. Unfortunately, this workaround overwrites
the 'not-allowed' cursor.
</Typography>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the Storybook with a "Disabled element" example, with workaround for Safari browser for the developers to decide what to use.

onMouseOver={handleOpen}
onMouseEnter={handleOpen}
onPointerEnter={handleOpen}
onPointerLeave={handleClose}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onPointerEnter and onPointerLeave fixed the issue in Chrome.

@pomfrida pomfrida changed the title [WIP] Trigger Tooltip on disabled elements Trigger Tooltip on disabled elements Aug 17, 2020
@pomfrida pomfrida marked this pull request as ready for review August 17, 2020 15:27
@pomfrida pomfrida requested review from mimarz and vnys as code owners August 17, 2020 15:27
@wenche wenche self-requested a review August 18, 2020 11:25
Copy link
Contributor

@wenche wenche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great research work! 👍

Safari... 😞

@pomfrida pomfrida merged commit 405dc15 into equinor:develop Aug 18, 2020
@pomfrida pomfrida deleted the Tooltip-Disabled-Bugfix branch August 18, 2020 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tooltip issue with disabled button
2 participants