3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 Code distributed by Google as part of the polymer project is also
8 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 --><html><head><link rel=
"import" href=
"../polymer/polymer.html">
10 <link rel=
"import" href=
"../paper-styles/default-theme.html">
11 <link rel=
"import" href=
"../paper-input/paper-input.html">
12 <link rel=
"import" href=
"../paper-menu-button/paper-menu-button.html">
13 <link rel=
"import" href=
"../paper-ripple/paper-ripple.html">
14 <link rel=
"import" href=
"../iron-a11y-keys-behavior/iron-a11y-keys-behavior.html">
15 <link rel=
"import" href=
"../iron-behaviors/iron-control-state.html">
16 <link rel=
"import" href=
"../iron-behaviors/iron-button-state.html">
17 <link rel=
"import" href=
"../iron-icons/iron-icons.html">
18 <link rel=
"import" href=
"../iron-icon/iron-icon.html">
19 <link rel=
"import" href=
"../iron-selector/iron-selectable.html">
22 `paper-dropdown-menu` is similar to a native browser select element.
23 `paper-dropdown-menu` works with selectable content. The currently selected
24 item is displayed in the control. If no item is selected, the `label` is
27 The child element with the class `dropdown-content` will be used as the dropdown
28 menu. It could be a `paper-menu` or element that triggers `iron-select` when
29 selecting its children.
33 <paper-dropdown-menu label="Your favourite pastry">
34 <paper-menu class="dropdown-content">
35 <paper-item>Croissant</paper-item>
36 <paper-item>Donut</paper-item>
37 <paper-item>Financier</paper-item>
38 <paper-item>Madeleine</paper-item>
40 </paper-dropdown-menu>
42 This example renders a dropdown menu with 4 options.
46 The following custom properties and mixins are also available for styling:
48 Custom property | Description | Default
49 ----------------|-------------|----------
50 `--paper-dropdown-menu` | A mixin that is applied to the element host | `{}`
51 `--paper-dropdown-menu-disabled` | A mixin that is applied to the element host when disabled | `{}`
52 `--paper-dropdown-menu-ripple` | A mixin that is applied to the internal ripple | `{}`
53 `--paper-dropdown-menu-button` | A mixin that is applied to the internal menu button | `{}`
54 `--paper-dropdown-menu-input` | A mixin that is applied to the internal paper input | `{}`
55 `--paper-dropdown-menu-icon` | A mixin that is applied to the internal icon | `{}`
57 You can also use any of the `paper-input-container` and `paper-menu-button`
58 style mixins and custom properties to style the internal input and menu button
62 @element paper-dropdown-menu
67 </head><body><dom-module id=
"paper-dropdown-menu">
70 display: inline-block;
75 --paper-input-container-input: {
78 text-overflow: ellipsis;
80 box-sizing: border-box;
84 @apply(--paper-dropdown-menu);
88 @apply(--paper-dropdown-menu-disabled);
91 :host([noink]) paper-ripple {
95 :host([no-label-float]) paper-ripple {
105 @apply(--paper-dropdown-menu-ripple);
109 @apply(--paper-dropdown-menu-button);
113 @apply(--paper-dropdown-menu-input);
117 color: var(--disabled-text-color);
119 @apply(--paper-dropdown-menu-icon);
124 <paper-menu-button id=
"menuButton" vertical-align=
"top" horizontal-align=
"right" vertical-offset=
"[[_computeMenuVerticalOffset(noLabelFloat)]]" disabled=
"[[disabled]]" no-animations=
"[[noAnimations]]" on-iron-select=
"_onIronSelect" opened=
"{{opened}}">
125 <div class=
"dropdown-trigger">
126 <paper-ripple></paper-ripple>
127 <paper-input readonly=
"" disabled=
"[[disabled]]" value=
"[[selectedItemLabel]]" placeholder=
"[[placeholder]]" always-float-label=
"[[alwaysFloatLabel]]" no-label-float=
"[[noLabelFloat]]" label=
"[[label]]">
128 <iron-icon icon=
"arrow-drop-down" suffix=
""></iron-icon>
131 <content id=
"content" select=
".dropdown-content"></content>
135 <script src=
"paper-dropdown-menu-extracted.js"></script></body></html>