Hello,
I've got an issue with paper-menu-button, with less than two paper-items, and I wonder if this is related to polymer, or dart-polymer, or myself not doing it right. The issue is that if I use paper-menu-button with zero paper-items, dart signals an exception (code blows up) (and chrome console signals an exception (Uncaught TypeError: Cannot read property 'offset' of undefined web-animations.js:2079)). Here is sample code that causes the exception:
<paper-menu-button id="menu" icon="menu" halign="left" title="Menu">
</paper-menu-button>
If I have one paper-item, then the code behaves fine, but no text is displayed for the item. Doing inspection in the browser shows that the opacity for the paper-item is set to zero; here is a copy of the inspected element (paper-item):
<paper-item label="Menu Item 1" class="menu-item core-selected" center="" horizontal="" layout="" active="" style="opacity: 0;"></paper-item>
Here is a sample code:
<paper-menu-button id="menu" icon="menu" halign="left" title="Menu">
<paper-item label="Menu Item 1" class="menu-item"></paper-item>
</paper-menu-button>
If I have at least two paper-items, then everything is good and works as expected. Inspecting the element (paper-item) now show (first item was selected):
<paper-item label="Menu Item 1" class="menu-item core-selected" center="" horizontal="" layout="" style="opacity: 1;" active=""></paper-item>
<paper-item label="Menu Item 2" class="menu-item" center="" horizontal="" layout="" style="opacity: 1;"></paper-item>
Here is a sample code:
<paper-menu-button id="menu" icon="menu" halign="left" title="Menu">
<paper-item label="Menu Item 1" class="menu-item"></paper-item>
<paper-item label="Menu Item 2" class="menu-item"></paper-item>
</paper-menu-button>
Is the paper-menu-button always expecting at least two paper-items? How should the menu be used with less than two paper-items?
I got the latest polymer and paper versions in my dart environment (dart version 1.6.0) (polymer >=0.12.0 <0.13.0, paper_elements >=0.1.0 <0.2.0, core_elements >=0.1.0 <0.2.0).
Best regards,
Jan