Skip to content

[interest invokers] How to define/control the action on "losing interest" #1064

@mfreed7

Description

@mfreed7

Here's a basic tooltip example:

<button interesttarget=tooltip>?</button>
<div popover=hint id=tooltip>Tooltip</div>

The desired behavior, for a tooltip, is:

  1. When the ? button is hovered/focused/etc for a short while ("interest"), the popover will be shown.
  2. The popover will stay open as long as either the button or the popover are hovered/focused/etc.
  3. When neither has been hovered/focused/etc for a short while ("interest has been lost"), the popover will be hidden.

It has been proposed, for the "invokers" proposal, to require the action (command) attribute. If that sticks, and is also required here, does that mean there will need to be two more action attributes? For example, we might need showinterestaction and loseinterestaction so that the above example becomes:

<button interesttarget=tooltip showinterestaction=showpopover loseinterestaction=hidepopover>?</button>
<div popover=hint id=tooltip>Tooltip</div>

I don't think a single value (e.g. interestaction=togglepopover) works. Because you could hover the button to show the popover, and then click outside, which will light-dismiss the popover, and then after a short while the "lose interest" event will happen, which will toggle the popover back open. Suppressing the "lose interest" event in this case seems a bit too magic.

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