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

feat(tooltip): support touch events #9487

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

driskull
Copy link
Member

Related Issue: #9273

Summary

  • support tap/touch events for tooltip
  • add test

@github-actions github-actions bot added the enhancement Issues tied to a new feature or request. label May 31, 2024
@driskull driskull marked this pull request as ready for review May 31, 2024 23:03
@driskull driskull requested a review from a team as a code owner May 31, 2024 23:03
Copy link
Contributor

github-actions bot commented Jun 8, 2024

This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions.

@github-actions github-actions bot added the Stale Issues or pull requests that have not had recent activity. label Jun 8, 2024
@benelan benelan changed the base branch from main to dev June 10, 2024 09:10
@github-actions github-actions bot removed the Stale Issues or pull requests that have not had recent activity. label Jun 11, 2024
@driskull driskull requested a review from jcfranco June 17, 2024 18:47
@driskull
Copy link
Member Author

@jcfranco can we do this one for June release?

@@ -151,15 +163,15 @@ export default class TooltipManager {
private addListeners(): void {
window.addEventListener("keydown", this.keyDownHandler, { capture: true });
window.addEventListener("pointermove", this.pointerMoveHandler, { capture: true });
window.addEventListener("click", this.clickHandler, { capture: true });
window.addEventListener("pointerdown", this.pointerDownHandler, { capture: true });
Copy link
Member

Choose a reason for hiding this comment

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

This should stay as a click since it does fire on mobile as well (see example). Also, pointerdown does not share the same context.

Alternatively, this could use pointerdown along with pointerup to prep for #9506.

Copy link
Member Author

Choose a reason for hiding this comment

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

done! had to remove a test which is no longer appropriate.

@driskull driskull requested a review from jcfranco June 21, 2024 22:25
@driskull driskull added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Jun 22, 2024
@driskull
Copy link
Member Author

@jcfranco ready for review again

@jcfranco
Copy link
Member

jcfranco commented Jun 22, 2024

It looks like there is a difference in behavior when clicking on an open tooltip (triggered by hovering the reference element):

dev (remains open on tooltip click)

https://www.chromatic.com/component?appId=6266d45509d7eb004aa254fb&csfId=components-tooltip&buildNumber=5123&k=66760245ca218413c410f678-1200px-interactive-true&h=7&b=-1

PR (closes on tooltip click)

https://www.chromatic.com/component?appId=6266d45509d7eb004aa254fb&csfId=components-tooltip&buildNumber=5125&k=667617c3abd71b94f44673b8-1200px-interactive-true&h=3&b=-1

Not sure if it's related to the removed test.

@driskull
Copy link
Member Author

@jcfranco I'm not seeing any difference there.

@jcfranco
Copy link
Member

For posterity, reached out to Matt and a step I missed to include was to hover over the reference element to display the tooltip before clicking. We also spotted an issue where clicking the reference element to toggle the tooltip and then clicking on the tooltip would close for both dev and the PR.

Copy link
Contributor

github-actions bot commented Jul 2, 2024

This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions.

@github-actions github-actions bot added the Stale Issues or pull requests that have not had recent activity. label Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues tied to a new feature or request. pr ready for visual snapshots Adding this label will run visual snapshot testing. Stale Issues or pull requests that have not had recent activity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants