Multiselect Dropdown
Multiselect dropdown provides a form render element which displays checkboxes in a dropdown select-like element.
For a full description of the module, visit the project page.
Submit bug reports and feature suggestions, or track changes in the issue queue.
Requirements
This module requires no modules outside of Drupal core.
Recommended Modules
- Better Exposed Filters: Allows for multiselect dropdowns to be used as exposed filter widgets in views.
Installation
Install as you would normally install a contributed Drupal module. For further information, see Installing Drupal Modules.
Configuration
Multiselect dropdown requires no configuration.
Usage
To use the multiselect dropdown form element in code see the class definition
at \Drupal\multiselect_dropdown\Element\MultiselectDropdown
for a description
of the render array keys and a usage example.
Views
To use the multiselect dropdown form element in views, enable the
multiselect_dropdown_bef
submodule and select "Allow multiple selections" in
the exposed filter settings. If the exposed filter is a taxonomy term then the
"Selection type" must also be set to "Dropdown". Once the exposed filter is
configured correctly the "Multiselect Dropdown" widget type will be available as
an "Exposed Filter Settings" option in the Better Exposed Filters form settings.
Theming
Multiselect dropdowns are fully themeable. If overriding the default template
the data-multiselect-dropdown-*
attributes must be present for JavaScript to
work. The module provides minimal CSS to ensure the widget works well with the
Claro admin theme and has basic functionality.
Accessibility
Multiselect dropdowns aim to be WCAG 2.2 AA compliant and provides additional text for screen readers on how to interact with the multiselect dropdown. If you find an issue, please create a new issue in the issue queue.
Browser Compatibility
The field widget uses the native HTML
<dialog>
element, a newer element not widely supported until
2022.
The multiselect_dropdown_polyfill
submodule provides a polyfill through
GoogleChrome/dialog-polyfill
which extends support through browsers released in or after 2019.
Maintainers
Current maintainer: