Skip to content

[popup] "Interest"-based triggering for popovers #526

@mfreed7

Description

@mfreed7

The explainer currently says this about the behavior for popup=hint (which I'll call "tooltips" for clarity):

Hint/Tooltip (popup=hint)

  • When opened, force-closes only other hints, but leaves all other popup types open.
  • Dismisses on close signal, click outside, when no longer hovered (after a timeout), or when the anchor element loses focus.

For the light dismiss triggers, everything except when no longer hovered is well defined. However, since we haven't discussed a declarative way to trigger tooltips, it isn't clear how "no longer hovered" should be defined. And even if there was a declarative trigger, what happens for tooltips that are programmatically triggered via tooltip.showPopup()? In order to answer questions about light dismiss for tooltips, I think we need to figure out how declarative invocation works.

Here's a quick strawman off-the-cuff idea:

<img src=questionmark.png hoverhint=foo>
<div popup=hint id=foo>Tooltip</div>
<style>
img {
  hint-trigger-delay=500ms;
}
[popup=hint] {
  hint-hide-delay=1000ms;
}
</style>

In other words, there is a new content attribute, hoverhint, which points to an element with popup=hint. When the <img> element (in this example, but could be any element type) is hovered, after a delay set by the hint-trigger-delay CSS property, the tooltip is shown. When that tooltip (or the triggering <img> element) has no longer been hovered for a time set by hint-hide-delay, it is hidden.

Again, this is a total strawman proposal. Suggestions appreciated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions