-
Notifications
You must be signed in to change notification settings - Fork 219
Open
Description
Consider the following example where both an interestfor and commandfor target the same popover:
<button
interestfor="my-popover"
commandfor="my-popover"
command="toggle-popover"
>?</a>
<div id="my-popover" popover="hint">Popover content</div>in this example, clicking the button hides the popover, if clicked again it shows it but gets light dismissed on hovering the button again. It would be nice if we could have this work such that clicking the button makes the popover persist so that the user does not have to continue hovering over the button. (And can then dismiss the popover by clicking the button again).
I would like to propose either:
- Changing the existing behavior:
toggle-popovershould not consider popovers shown byinterestforwhen deciding the toggle state, and losing interest should not clear an explictly opened popover (whether viatoggle-popover/show-popoverin HTML or the equivalent in JS).- I think this is preferable as I don't see how the current behavior is useful to either developers or users
- Adding a new value and state to popovers (all names to be bike-shedded):
show-persistent-popoverwhich shows a popover and prevents losing interest from the popover- and an equivalent JS api
.showPopover({ preventDismissOnInterestLoss: true })
- and an equivalent JS api
hide-persistent-popoverwhich hides a popover that was shown viashow-persistent-popoverbut doesn't hide a popover which is shown due to interest- and an equivalent JS api
.hidePopover({ allowInterestToContinueShowing: true })
- and an equivalent JS api
toggle-popover-persistentwhich is a combination of the above properties in the same way astoggle-popover
Just to clarify what the intended user flow would be:
- Initially the popover is hidden
- The user hovers the button and the popover is shown due to interest
- The user clicks the button, this causes the popover to persist (not be hidden as current behavior)
- The user can freely move their pointer around, the popover will persist (and hovering the button should not cause an implicit dismiss due to interest loss)
- The user clicks the button again which causes the popover to no longer be persistent and will be light dismissed when the user stops hovering the button
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels