google / google/material-design-lite

Tooltips functionality - Show on mobile only during touch state

Open
#1,957 0 comments 0 reactions 0 assignees View on GitHub
MD Alignment Tooltip
Dominant language
HTML
Stars
32.2k
Forks
4.9k
PR merge metrics
No merged PRs in 30d

Description

So, the [tooltip spec](https://www.google.com/design/spec/components/tooltips.html#) specifically says:

> upon touch (without releasing) in a touch UI

Currently, we do it on touch and persist even through a scroll action. Any good way to come into alignment here?

We could listen on touchstart to show the tooltip and on touchend kill it. But, in testing this just now, Chrome and FF after a few seconds emit a [TouchCancel event](https://developer.mozilla.org/en-US/docs/Web/Events/touchcancel) which is due to them showing the context menu from the long-press. I have yet to find a direct solution to the problem as the "onContextMenu" event I'm seeing doesn't seem to fire at all, so can't cancel it that way.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.