If set and no value is set/selected, this phrase is shown in the header. Otherwise the first item will get selected.
Can also be used to set a "none" value of a dropdown untill an item gets selected, even if the dropdown does not have a header.
Should the dropdown stay open?
The value of the dropdown. Represents the value of the selected dropdown item.
Updates the component. Needs to be called when subcomponents where added or removed ("hylo-dropdown-header", "hylo-dropdown-item").
Optional
item_selection: booleanif set, a possibly selected item will set/define the value of the dropdown (otherwise the value will select an item)
Fires when the dropdown gets closed.
Fires when the dropdown gets opened.
Fires when the value changed. Emits the new value.
Fires when an already selected item was clicked.
Generated using TypeDoc
A dropdown.
Place hylo-dropdown-item components inside the component to define the elements of the dropdown. Place a hylo-dropdown-header before the hylo-dropdown-item components to create a header. A dropdown does not need to have a header necessarily.
The header and/or item components don't have to be direct children of the hylo-dropdown component. E.g. you could wrap them into hylo-accessibility components like hylo-accessibility-list to add more functionality. You have to make sure that the ancestor of the header and the ancestor(s) of the items, which are the direct children of the hylo-dropdown component, are not the same.
To get accessibility features out of the box use hylo-accessibility-dropdown.
You can preselect an item by setting it "selected" while creating the dropdown or by giving the hylo-dropdown component a value. The component will automaticly select the item with the same value.
You can change the selected item by setting a not selected item "selected" or change the value of the component. The component will automaticly select the item with the same value.
To open/close the dropdown without triggering the transition just add/remove the css class "open".
Listens to the event "hyloAccessibilityListEscape" to close the dropdown when necessary.