shoelace icon indicating copy to clipboard operation
shoelace copied to clipboard

Popover

Open RaviDesai opened this issue 4 years ago • 5 comments

Is your feature request related to a problem? Please describe. Your tooltip control already wraps popover as a Utility. Would love to see a full blown popover control that supports complex contents (not just strings).

Describe the solution you'd like I think a simple extension of the tooltip utility you already have would be perfect.

Describe alternatives you've considered I've written my own in my own library, but this is the kind of code that I'd prefer NOT to have to write, and you'll do it better for sure.

Additional context None

RaviDesai avatar Jul 17 '20 11:07 RaviDesai

Thanks for suggesting this! Indeed, since Popper is already included, this won't add a ton of weight to the library. First-class popovers are definitely on the radar.

claviska avatar Jul 17 '20 12:07 claviska

@RaviDesai Is this issue still relevant since <sl-tooltip> allows html markup if slot="content" attribute is used? https://shoelace.style/components/tooltip?id=examples

trailsnail avatar Oct 05 '21 17:10 trailsnail

@trailsnail

I argue yes. I expect a popover to function like Chakras popover. The main difference between a popover and a tooltip is first and foremost the name. Using a tooltip for a popover "is hacky". Secondly, a tooltip is triggered with a hover or focus while a popover is triggered by a click. And lastly, a popover can be closed with a click (x in the top right corner).

samuelstroschein avatar Oct 14 '21 11:10 samuelstroschein

@samuelstroschein This sounds like https://shoelace.style/components/dialog ❓

trailsnail avatar Oct 14 '21 11:10 trailsnail

Popovers are similar to tooltips in that they share some behaviors and positioning, but popovers are more powerful and can be used for things like hovercards and in-context confirmations. There's also styling differences and — I need to verify — I believe they have some a11y differences under the hood.

Example: https://ant.design/components/popover/

In another library I maintain, our popover was based off tooltip but it served very different purposes.

claviska avatar Oct 14 '21 11:10 claviska