Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,25 @@ <h4>Alternate Button</h4>
</div>
</div>

<div class="horizontal-section-container">
<div>
<h4>Alternate Button with visible content</h4>
<div class="horizontal-section">
<paper-menu-button show-content >
<paper-button class="dropdown-trigger" raised>
<iron-icon icon="check"></iron-icon>
<span>Dinosaurs</span>
</paper-button>
<paper-menu class="dropdown-content">
<template is="dom-repeat" items="[[dinosaurs]]" as="dinosaur">
<paper-item>[[dinosaur]]</paper-item>
</template>
</paper-menu>
</paper-menu-button>
</div>
</div>
</div>

<div class="horizontal-section-container">
<div>
<h4>Alternate Content</h4>
Expand Down
27 changes: 27 additions & 0 deletions paper-menu-button.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@
margin-top: 20px;
}

:host([vertical-align="top"][show-content]) paper-material {
margin-top: 43px;
}

:host([vertical-align="bottom"][show-content]) paper-material {
margin-bottom: 43px;
}

iron-dropdown {
@apply(--paper-menu-button-dropdown);
}
Expand All @@ -110,6 +118,7 @@
<iron-dropdown
id="dropdown"
opened="{{opened}}"
no-auto-focus="[[noAutoFocus]]"
horizontal-align="[[horizontalAlign]]"
vertical-align="[[verticalAlign]]"
horizontal-offset="[[horizontalOffset]]"
Expand Down Expand Up @@ -286,6 +295,24 @@
*/
_dropdownContent: {
type: Object
},
/**
* Set to true to keep focus on menu button element content.
* For example input in paper-dropdown-menu if filtering is needed. This attribute doesn't manage visibility
* button element content.
*/
noAutoFocus: {
type: Boolean,
value: false,
reflectToAttribute: true
},
/**
* Set to true if button element content should be visible after dropdown would be shown
*/
showContent:{
type: Boolean,
value: false,
reflectToAttribute: true
}
},

Expand Down