| 1 |
{{! |
| 2 |
See @typedef MenuDefinition |
| 3 |
}} |
| 4 |
{{! this template must be used with Dropdown/Close to avoid unclosed HTML tags }} |
| 5 |
<div id="{{id}}" class="vector-dropdown{{#class}} {{.}}{{/class}}" {{{html-tooltip}}} {{{html-user-language-attributes}}}> |
| 6 |
{{! |
| 7 |
Dropdown menus use the checkbox hack and require `input` and `label` elements. |
| 8 |
The `label` element functions as the "visual" button and is hidden from screenreader users (T325026) |
| 9 |
while the `input` element is the actual semantic button for toggling the dropdown. |
| 10 |
The `input` element will always have an `aria-label`, which will usually match the |
| 11 |
text inside the `label` element, unless an alternative label is provided via the `#aria-label` |
| 12 |
mustache template data. |
| 13 |
}} |
| 14 |
<input {{! |
| 15 |
}}type="checkbox" {{! |
| 16 |
}}id="{{id}}-checkbox" {{! |
| 17 |
}}role="button" {{! |
| 18 |
}}aria-haspopup="true" {{! |
| 19 |
}}data-event-name="ui.dropdown-{{id}}" {{!-- |
| 20 |
}}class="vector-dropdown-checkbox{{#checkbox-class}} {{.}}{{/checkbox-class}}" {{! |
| 21 |
}}{{#aria-label}}aria-label="{{.}}"{{/aria-label}} {{! |
| 22 |
}}{{^aria-label}}aria-label="{{label}}"{{/aria-label}} {{! |
| 23 |
}}{{#html-vector-menu-checkbox-attributes}} {{{.}}}{{/html-vector-menu-checkbox-attributes}}> |
| 24 |
<label {{! |
| 25 |
}}id="{{id}}-label" {{! |
| 26 |
}}for="{{id}}-checkbox" {{! |
| 27 |
}}class="vector-dropdown-label{{#label-class}} {{.}}{{/label-class}}" {{! |
| 28 |
}}aria-hidden="true" {{! |
| 29 |
}}{{#html-vector-menu-label-attributes}} {{{.}}}{{/html-vector-menu-label-attributes}}>{{! |
| 30 |
}}{{#icon}}{{>Icon}}{{/icon}}{{! |
| 31 |
}}<span class="vector-dropdown-label-text">{{label}}</span> |
| 32 |
</label> |
| 33 |
<div class="vector-dropdown-content"> |
| 34 |
|