material icon indicating copy to clipboard operation
material copied to clipboard

mdPopover: use mdPanel to create popover example

Open ThomasBurleson opened this issue 11 years ago • 116 comments

Unlike tooltips which have minimal content, popups can have sophisticated, rich content and should also use a directional indicator pointing to the originating/requesting element:

Example #1: popover

Popovers are intended to have rich content that may be fully interactive.

ThomasBurleson avatar Jan 17 '15 23:01 ThomasBurleson

This is related to the Pull Request #1132.

ThomasBurleson avatar Jan 17 '15 23:01 ThomasBurleson

This specifications for this feature have been requested from the Material Design UX team. [response pending]

ThomasBurleson avatar Jan 17 '15 23:01 ThomasBurleson

Would this be something you can click on links inside of or just for showing content?

epelc avatar Jan 18 '15 02:01 epelc

Popovers are intended to have rich content that may be fully interactive.

tooltips_usage1

Tooltips, however, are:

  • terse,
  • read-only,
  • transient,
  • self-closing,
  • single-line,
  • informational constructs:

ThomasBurleson avatar Jan 18 '15 05:01 ThomasBurleson

So something a bit like a material version of DropJS (http://github.hubspot.com/drop/docs/welcome/)? If so I really like the idea. Covers that ground where you need a richer experience than a tooltip but without being as obtrusive as a dialog taking over your screen.

ccarpediem avatar Jan 21 '15 20:01 ccarpediem

@ccarpediem - yes.

ThomasBurleson avatar Jan 21 '15 20:01 ThomasBurleson

This is just a <md-tooltip> with large content and a class added to it.

ajoslin avatar Jan 24 '15 18:01 ajoslin

@ccarpediem Here is my implementation for material design: https://github.com/stevenh77/drop-ng

@ajoslin tooltips appear on hover whereas my implementation of a popover is activated on click.

Here is the bootstrap version: http://getbootstrap.com/javascript/#popovers

stevenh77 avatar Jan 26 '15 09:01 stevenh77

@stevenh77 Looks good. One additional thing I think would be nice, is an optional parameter you could pass to define how it closes. Right now, it seems you need to click the button again to close it. I can see the option of just clicking anywhere on the screen closing it like tooltip and dialog would at least be nice option to have. Not sure which is the better default behavior.

ccarpediem avatar Jan 26 '15 12:01 ccarpediem

Nice work @stevenh77

Where does the options reference "options.rootElementKeyupCallback" on line 113 come from? https://github.com/stevenh77/material/blob/popover-feature/src/components/popover/popover.js#L113

Problem being placed in scroll sections: https://www.dropbox.com/s/gx85c9qkz729a4h/angular-material-popover.mp4?dl=0

It should also probably follow the material design principles, animating out from the interaction point, or whatever that fanciness would be, like the tooltip, or dialog do.

leefernandes avatar Jan 26 '15 15:01 leefernandes

@stevenh77 is there the option to change how quickly it opens? What about making it more material open from click location and expand style?

ilanbiala avatar Jan 26 '15 18:01 ilanbiala

@ilanbiala @ccarpediem @ItsLeeOwen not currently but you're welcome to add the functionality.

@ItsLeeOwen that's deregistering the "escape key to close" functionality.

stevenh77 avatar Jan 26 '15 18:01 stevenh77

@ItsLeeOwen scrolling fixed

demo

stevenh77 avatar Jan 28 '15 13:01 stevenh77

Replacement pull request: https://github.com/angular/material/pull/1324

stevenh77 avatar Jan 28 '15 17:01 stevenh77

@ccarpediem hopefully material design will decide to include a popover component. In the meantime if anyone wants to use dropjs I've created an Angular wrapper called drop-ng, available through bower. http://github.com/stevenh77/drop-ng

stevenh77 avatar Jan 31 '15 10:01 stevenh77

As per review with UX team, popover's aren't intended in material design's spec. A floating card originating from a point would be a better UX.

rschmukler avatar Feb 02 '15 18:02 rschmukler

@stevenh77 - Your fork demonstrates the Popover in a very nice way. Thank you for such a nicely done submission to Angular Material. The UX team, however, wants to clearly separate the usages of tooltips from floatingCards and fear that Popovers violate the Material Design concepts. Much of the work you have done will be used as consideration when the "Floating Card" is implemented.

ThomasBurleson avatar Feb 02 '15 18:02 ThomasBurleson

The dialog component is just a few tweaks away from being a great "popover", "floating card", "thing that displays interactive content positioned aside, above, or below the interaction point"... whatever a UX team wants to call it. This is the result of only a few changes to the dialog onShow method, and stylesheet. And you get the benefit of useful functionality found in $mdDialog, which I don't see in the mdCard directive.

leefernandes avatar Feb 04 '15 15:02 leefernandes

I've added a "position" option to $mdDialog.show() to provide 8 possible layout configurations that are "popover-like". Here's a visual example:

https://www.dropbox.com/s/n9gcq9g2fudjnzk/angular-material-dialog-positioning.mp4?dl=0

leefernandes avatar Feb 04 '15 17:02 leefernandes

@ItsLeeOwen Can you please share the dialog positioning code? Thanks! :)

shlomozippel avatar Apr 16 '15 00:04 shlomozippel