From c974e42ff2dd2c3a6c292f4560e54398e2744457 Mon Sep 17 00:00:00 2001 From: Pascal LE QUANG Date: Tue, 10 Oct 2017 09:23:07 +0200 Subject: [PATCH] Added fitInto property, forwarded to underlying iron-dropdown. Fixes #108. --- demo/index.html | 29 +++++++++++++++++++ paper-menu-button.html | 10 +++++++ test/paper-menu-button.html | 55 ++++++++++++++++++++++++++++++++++++- 3 files changed, 93 insertions(+), 1 deletion(-) diff --git a/demo/index.html b/demo/index.html index d00dd45..509aa51 100644 --- a/demo/index.html +++ b/demo/index.html @@ -68,6 +68,13 @@ .horizontal-section { text-align: center; } + + #fitIntoContainer { + height: 150px; + width: 100%; + text-align: center; + border: 1px solid black; + } @@ -200,6 +207,28 @@

Alternate Content

+

Fit dropdown into container

+ + + \ No newline at end of file diff --git a/paper-menu-button.html b/paper-menu-button.html index f4c1503..ece85a7 100644 --- a/paper-menu-button.html +++ b/paper-menu-button.html @@ -120,6 +120,7 @@ horizontal-align="[[horizontalAlign]]" vertical-align="[[verticalAlign]]" dynamic-align="[[dynamicAlign]]" + fit-into="[[fitInto]]" horizontal-offset="[[horizontalOffset]]" vertical-offset="[[verticalOffset]]" no-overlap="[[noOverlap]]" @@ -206,6 +207,15 @@ type: Boolean }, + + /** + * The element to fit the dropdown into. + */ + fitInto: { + type: Object, + value: window + }, + /** * A pixel value that will be added to the position calculated for the * given `horizontalAlign`. Use a negative value to offset to the diff --git a/test/paper-menu-button.html b/test/paper-menu-button.html index b1ec82f..623d74f 100644 --- a/test/paper-menu-button.html +++ b/test/paper-menu-button.html @@ -19,7 +19,17 @@ - + @@ -45,6 +55,16 @@ + + + +