Adds a hylo-accessibility-focus component to the hylo-dropdown-header component.
Text to be announcent in a screen reader when the dropdown gets closed.
Text to be announced in a screen reader when the dropdown gets opened.
If set, the dropdown opens when the header has the focus and the arrow down key is pressed.
By default, only the space and enter key opens the dropdown.
If the type is "menu" you can choose for the list items role between "menuitemcheckbox", "menuitemradio" or simple "menuitem" if checkable is not set.
Text only for screen readers which gets put after the regular header text.
Text only for screen readers which gets put in front of the regular header text.
A level value of the list which will be set as "aria-level".
If set, no default hylo-dropdown-header component is included.
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.
If set, the content of the header does not change. By default the content of the selected hylo-dropdown-item component is shown.
Adds a hylo-sr-only component to the hylo-dropdown-header component.
Might help if the screen reader does not read out the content of the header component.
If set and you keyboard tab forward out of the dropdown menu, the default dropdown header gets the focus instead of the next element in the focus order. The dropdown closes anyways.
If set and you keyboard tab back from the dropdown menu to the default dropdown header, the dropdown closes.
The type of list. Will be translated into a "role" value.
Also defines the "role" values of the list items.
Updates the component. Needs to be called when subcomponents where added or removed (e.g. "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. Emits the value.
Generated using TypeDoc
Creates a hylo-dropdown component with a default hylo-dropdown-header included. Unlike a plain hylo-dropdown component it adds accessibility features out of the box.
Place hylo-dropdown-item components inside this component. You have to give the hylo-dropdown-item components the class "hylo-accessibility-list-child" if they are not a direct child of this component to be picked up as part of the opptions list of the dropdown. Also the hylo-dropdown-item component itself or one of its children need to be tabable (tabindex >= 0) as well.
Slots: