googlearchive / paper-menu

A Material Design menu
https://www.webcomponents.org/element/PolymerElements/paper-menu
27 stars 48 forks source link

Upgrades paper-menu to polymer2.0-preview in hybrid mode. Fixes #110 #113

Closed YvanDaSilva closed 7 years ago

YvanDaSilva commented 7 years ago

Fixes #110 Code, documentation, tests and dependencies have been upgraded to work with Polymer#2.0-preview

notwaldorf commented 7 years ago

Thanks for the PR! Unfortunately, we did not port this element deliberately, since it's deprecated in favour of paper-listbox, which has been ported already.

YvanDaSilva commented 7 years ago

@notwaldorf Thank you for the message. You should also close https://github.com/PolymerElements/paper-menu/issues/110 then, or comment for depreciation of the element. Best regards, Yvan.

rene-lindner-isw commented 7 years ago

@notwaldorf Since paper-menu is deprecated, will there be a paper-submenu replacement? Or should we just use iron-collapse instead?

YvanDaSilva commented 7 years ago

@rene-lindner-isw IMHO, you can use paper-listbox and iron-collapse together it will provide you the same functionality without creating a specific element that just combines both. (Well you can do that on your side)

guss77 commented 7 years ago

@YvanDaSilva - I'm not sure how to use paper-listbox and iron-collapse as a replacement for paper-menu and paper-submenu - I've ran some searches in the last couple of days and have failed to locate an example.

From looking at the iron-collapse example, it looks like it requires writing an event handler for each instance of iron-collapse used, which isn't a good idea as an implementation for a collapsible menu system - it looks like a lot of heavy lifting for the causal developer and an opportunity for something like paper-menu/paper-submenu to streamline that.

rene-lindner-isw commented 7 years ago

@guss77 Since the collapse don't use the "trigger" - "content" slots pattern like e.g. iron-overlay and it's paper childs, this is actually true, you have to listen to tap events and open the collapse manual.

Having a trigger slot in the iron-collapse would make this pretty easy.

<iron-collapse>
  <paper-item slot="collapse-trigger">Submenu</paper-item>
  <paper-listbox slot="collapse-content">
    ...
  </paper-listbox>
</iron-collapse>
guss77 commented 7 years ago

@rene-lindner-isw - I agree that if iron-collapse would have those features, it would be make iron-collapse and paper friends a useful replacement to paper-menu and paper-submenu.

Seeing as that is not the case, and until that gap is filled (if it is something that can be filled - my understanding is that iron elements are supposed to be low level bare-bones behaviors to be used by more visual elements in the paper elements family, so its likely the iron-collapse maintainer would not accept such an enhancement), I think it is not a good idea to obsolete paper-menu.

I think its better to accept code that is already available to upgrade paper-menu for Polymer 2.0, than to reject it and leave an implementation gap that may or may not be filled in the future. Deprecating and putting a note to let people know they better use something else is fine, but deleting working (or almost working) code, is not.

YvanDaSilva commented 7 years ago

@guss77 I restored my branch if that is really useful for you. I sadly don't have the time to look into this for now or for an alternative solution.

YvanDaSilva commented 7 years ago

@guss77 Have a look at : https://github.com/YvanDaSilva/sublistbox-gist Sorry I couldn't reply earlier, I've been really busy.