Fixed #2814 - Improve MultiSelect implementation for Accessibility

pull/2817/head
mertsincan 2022-07-29 05:18:45 +01:00
parent 9155e9e0c7
commit 7f446cf360
4 changed files with 1327 additions and 560 deletions

View File

@ -47,6 +47,66 @@ const MultiSelectProps = [
default: "200px",
description: "Height of the viewport, a scrollbar is defined if height of list exceeds this value."
},
{
name: "placeholder",
type: "string",
default: "null",
description: "Label to display when there are no selections."
},
{
name: "disabled",
type: "boolean",
default: "false",
description: "When present, it specifies that the component should be disabled."
},
{
name: "inputId",
type: "string",
default: "null",
description: "Identifier of the underlying input element."
},
{
name: "inputProps",
type: "object",
default: "null",
description: "Uses to pass all properties of the HTMLInputElement to the focusable input element inside the component."
},
{
name: "panelStyle",
type: "object",
default: "null",
description: "Inline style of the overlay panel."
},
{
name: "panelClass",
type: "string",
default: "null",
description: "Style class of the overlay panel."
},
{
name: "panelProps",
type: "object",
default: "null",
description: "Uses to pass all properties of the HTMLDivElement to the overlay panel."
},
{
name: "filterInputProps",
type: "object",
default: "null",
description: "Uses to pass all properties of the HTMLInputElement to the filter input inside the overlay panel."
},
{
name: "closeButtonProps",
type: "object",
default: "null",
description: "Uses to pass all properties of the HTMLButtonElement to the close button inside the overlay panel."
},
{
name: "dataKey",
type: "string",
default: "null",
description: "A property to uniquely identify an option."
},
{
name: "filter",
type: "boolean",
@ -78,52 +138,10 @@ const MultiSelectProps = [
description: "Fields used when filtering the options, defaults to optionLabel."
},
{
name: "placeholder",
name: "appendTo",
type: "string",
default: "null",
description: "Label to display when there are no selections."
},
{
name: "disabled",
type: "boolean",
default: "false",
description: "When present, it specifies that the component should be disabled."
},
{
name: "tabindex",
type: "string",
default: "null",
description: "Index of the element in tabbing order."
},
{
name: "inputId",
type: "string",
default: "null",
description: "Identifier of the underlying input element."
},
{
name: "dataKey",
type: "string",
default: "null",
description: "A property to uniquely identify an option."
},
{
name: "ariaLabelledBy",
type: "string",
default: "null",
description: 'A valid query selector or an HTMLElement to specify where the overlay gets attached. Special keywords are "body" for document body and "self" for the element itself.'
},
{
name: "emptyFilterMessage",
type: "string",
default: "No results found",
description: "Text to display when filtering does not return any results. Defaults to value from PrimeVue locale configuration."
},
{
name: "emptyMessage",
type: "string",
default: "No results found",
description: "Text to display when there are no options available. Defaults to value from PrimeVue locale configuration."
default: "body",
description: "A valid query selector or an HTMLElement to specify where the overlay gets attached. Special keywords are 'body' for document body and 'self' for the element itself."
},
{
name: "display",
@ -132,10 +150,16 @@ const MultiSelectProps = [
description: 'Defines how the selected items are displayed, valid values are "comma" and "chip".'
},
{
name: "panelClass",
name: "selectedItemsLabel",
type: "string",
default: "{0} items selected",
description: "Label to display after exceeding max selected labels."
},
{
name: "maxSelectedLabels",
type: "number",
default: "null",
description: "Style class of the overlay panel."
description: "Decides how many selected item labels to show at most."
},
{
name: "selectionLimit",
@ -161,18 +185,6 @@ const MultiSelectProps = [
default: "pi pi-spinner pi-spin",
description: "Icon to display in loading state."
},
{
name: "maxSelectedLabels",
type: "number",
default: "null",
description: "Decides how many selected item labels to show at most."
},
{
name: "selectedItemsLabel",
type: "string",
default: "{0} items selected",
description: "Label to display after exceeding max selected labels."
},
{
name: "selectAll",
type: "boolean",
@ -191,6 +203,60 @@ const MultiSelectProps = [
default: "null",
description: "Whether to use the virtualScroller feature. The properties of VirtualScroller component can be used like an object in it."
},
{
name: "autoOptionFocus",
type: "boolean",
default: "true",
description: "Whether to focus on the first visible or selected element when the overlay panel is shown."
},
{
name: "filterMessage",
type: "string",
default: "{0} results are available",
description: "Text to be displayed in hidden accessible field when filtering returns any results. Defaults to value from PrimeVue locale configuration."
},
{
name: "selectionMessage",
type: "string",
default: "{0} items selected",
description: "Text to be displayed in hidden accessible field when options are selected. Defaults to value from PrimeVue locale configuration."
},
{
name: "emptySelectionMessage",
type: "string",
default: "No selected item",
description: "Text to be displayed in hidden accessible field when any option is not selected. Defaults to value from PrimeVue locale configuration."
},
{
name: "emptyFilterMessage",
type: "string",
default: "No results found",
description: "Text to display when filtering does not return any results. Defaults to value from PrimeVue locale configuration."
},
{
name: "emptyMessage",
type: "string",
default: "No results found",
description: "Text to display when there are no options available. Defaults to value from PrimeVue locale configuration."
},
{
name: "tabindex",
type: "number",
default: "null",
description: "Index of the element in tabbing order."
},
{
name: "ariaLabel",
type: "string",
default: "null",
description: "Defines a string value that labels an interactive element."
}
{
name: "ariaLabelledby",
type: "string",
default: "null",
description: "Identifier of the underlying input element."
}
];
const MultiSelectEvents = [
@ -210,6 +276,28 @@ const MultiSelectEvents = [
}
]
},
{
name: "focus",
description: "Callback to invoke when component receives focus.",
arguments: [
{
name: "event",
type: "object",
description: "Browser event"
}
]
},
{
name: "blur",
description: "Callback to invoke when component loses focus.",
arguments: [
{
name: "event",
type: "object",
description: "Browser event"
}
]
},
{
name: "before-show",
description: "Callback to invoke before the overlay is shown."
@ -261,18 +349,18 @@ const MultiSelectEvents = [
];
const MultiSelectSlots = [
{
name: "option",
description: "Custom content for the item's option"
},
{
name: "optiongroup",
description: "Custom content for the item's optiongroup"
},
{
name: "value",
description: "Custom content for the item value"
},
{
name: "chip",
description: "Custom content for the chip display."
},
{
name: "indicator",
description: "Custom content for the dropdown indicator"
},
{
name: "header",
description: "Custom content for the component's header"
@ -281,6 +369,14 @@ const MultiSelectSlots = [
name: "footer",
description: "Custom content for the component's footer"
},
{
name: "option",
description: "Custom content for the item's option"
},
{
name: "optiongroup",
description: "Custom content for the item's optiongroup"
},
{
name: "emptyfilter",
description: "Custom content when there is no filtered data to display"
@ -289,10 +385,6 @@ const MultiSelectSlots = [
name: "empty",
description: "Custom content when there is no data to display"
},
{
name: "chip",
description: "Custom content for the chip display."
},
{
name: "content",
description: "Custom content for the virtual scroller"
@ -300,10 +392,6 @@ const MultiSelectSlots = [
{
name: "loader",
description: "Custom content for the virtual scroller loader items"
},
{
name: "indicator",
description: "Custom content for the dropdown indicator"
}
];

View File

@ -2,13 +2,13 @@ import { VNode } from 'vue';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
import { VirtualScrollerProps, VirtualScrollerItemOptions } from '../virtualscroller';
type MultiSelectOptionLabelType = string | ((data: any) => string) | undefined;
type MultiSelectOptionLabelType = string | ((data: any) => string) | undefined;
type MultiSelectOptionValueType = string | ((data: any) => any) | undefined;
type MultiSelectOptionValueType = string | ((data: any) => any) | undefined;
type MultiSelectOptionDisabledType = string | ((data: any) => boolean) | undefined;
type MultiSelectOptionDisabledType = string | ((data: any) => boolean) | undefined;
type MultiSelectOptionChildrenType = string | ((data: any) => any[]) | undefined;
type MultiSelectOptionChildrenType = string | ((data: any) => any[]) | undefined;
type MultiSelectFilterMatchModeType = 'contains' | 'startsWith' | 'endsWith' | undefined;
@ -49,7 +49,7 @@ export interface MultiSelectFilterEvent {
value: string;
}
export interface MultiSelectProps {
export interface MultiSelectProps extends HTMLDivElement {
/**
* Value of the component.
*/
@ -91,14 +91,34 @@ export interface MultiSelectProps {
* When present, it specifies that the component should be disabled.
*/
disabled?: boolean | undefined;
/**
* Index of the element in tabbing order.
*/
tabindex?: string | number | undefined;
/**
* Identifier of the underlying input element.
*/
inputId?: string | undefined;
/**
* Uses to pass all properties of the HTMLInputElement to the focusable input element inside the component.
*/
inputProps?: HTMLInputElement | undefined;
/**
* Inline style of the overlay panel.
*/
panelStyle?: any;
/**
* Style class of the overlay panel.
*/
panelClass?: any;
/**
* Uses to pass all properties of the HTMLDivElement to the overlay panel.
*/
panelProps?: HTMLDivElement | undefined;
/**
* Uses to pass all properties of the HTMLInputElement to the filter input inside the overlay panel.
*/
filterInputProps?: HTMLInputElement | undefined;
/**
* Uses to pass all properties of the HTMLButtonElement to the clear button inside the overlay panel.
*/
closeButtonProps?: HTMLButtonElement | undefined;
/**
* A property to uniquely identify an option.
*/
@ -125,36 +145,18 @@ export interface MultiSelectProps {
* Fields used when filtering the options, defaults to optionLabel.
*/
filterFields?: string[] | undefined;
/**
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
*/
ariaLabelledBy?: string | undefined;
/**
* A valid query selector or an HTMLElement to specify where the overlay gets attached. Special keywords are 'body' for document body and 'self' for the element itself.
* @see MultiSelectAppendToType
* Default value is 'body'.
*/
appendTo?: MultiSelectAppendToType;
/**
* Text to display when filtering does not return any results. Defaults to value from PrimeVue locale configuration.
* Default value is 'No results found'.
*/
emptyFilterMessage?: string | undefined;
/**
* Text to display when there are no options available. Defaults to value from PrimeVue locale configuration.
* Default value is 'No results found'.
*/
emptyMessage?: string | undefined;
/**
* Defines how the selected items are displayed.
* @see MultiSelectDisplayType
* Default value is 'comma'.
*/
display?: MultiSelectDisplayType;
/**
* Style class of the overlay panel.
*/
panelClass?: any;
/**
* Label to display after exceeding max selected labels.
* Default value is '{0} items selected'.
@ -195,6 +197,48 @@ export interface MultiSelectProps {
* @see VirtualScroller.VirtualScrollerProps
*/
virtualScrollerOptions?: VirtualScrollerProps;
/**
* Whether to focus on the first visible or selected element when the overlay panel is shown.
* Default value is true.
*/
autoOptionFocus?: boolean | undefined;
/**
* Text to be displayed in hidden accessible field when filtering returns any results. Defaults to value from PrimeVue locale configuration.
* Default value is '{0} results are available'.
*/
filterMessage?: string | undefined;
/**
* Text to be displayed in hidden accessible field when options are selected. Defaults to value from PrimeVue locale configuration.
* Default value is '{0} items selected'.
*/
selectionMessage?: string | undefined;
/**
* Text to be displayed in hidden accessible field when any option is not selected. Defaults to value from PrimeVue locale configuration.
* Default value is 'No selected item'.
*/
emptySelectionMessage?: string | undefined;
/**
* Text to display when filtering does not return any results. Defaults to value from PrimeVue locale configuration.
* Default value is 'No results found'.
*/
emptyFilterMessage?: string | undefined;
/**
* Text to display when there are no options available. Defaults to value from PrimeVue locale configuration.
* Default value is 'No results found'.
*/
emptyMessage?: string | undefined;
/**
* Index of the element in tabbing order.
*/
tabindex?: number | string | undefined;
/**
* Defines a string value that labels an interactive element.
*/
ariaLabel?: string | undefined;
/**
* Identifier of the underlying input element.
*/
ariaLabelledby?: string | undefined;
}
export interface MultiSelectSlots {
@ -212,6 +256,20 @@ export interface MultiSelectSlots {
*/
placeholder: string;
}) => VNode[];
/**
* Custom chip template.
* @param {Object} scope - chip slot's params.
*/
chip: (scope: {
/**
* A value in the selection
*/
value: any;
}) => VNode[];
/**
* Custom indicator template.
*/
indicator: () => VNode[];
/**
* Custom header template.
* @param {Object} scope - header slot's params.
@ -240,14 +298,6 @@ export interface MultiSelectSlots {
*/
options: any[];
}) => VNode[];
/**
* Custom emptyfilter template.
*/
emptyfilter: () => VNode[];
/**
* Custom empty template.
*/
empty: () => VNode[];
/**
* Custom option template.
* @param {Object} scope - option slot's params.
@ -277,15 +327,13 @@ export interface MultiSelectSlots {
index: number;
}) => VNode[];
/**
* Custom chip template.
* @param {Object} scope - chip slot's params.
* Custom emptyfilter template.
*/
chip: (scope: {
/**
* A value in the selection
*/
value: any;
}) => VNode[];
emptyfilter: () => VNode[];
/**
* Custom empty template.
*/
empty: () => VNode[];
/**
* Custom content template.
* @param {Object} scope - content slot's params.
@ -321,10 +369,6 @@ export interface MultiSelectSlots {
*/
options: any[];
}) => VNode[];
/**
* Custom indicator template.
*/
indicator: () => VNode[];
}
export declare type MultiSelectEmits = {
@ -338,6 +382,16 @@ export declare type MultiSelectEmits = {
* @param {MultiSelectChangeEvent} event - Custom change event.
*/
'change': (event: MultiSelectChangeEvent) => void;
/**
* Callback to invoke when the component receives focus.
* @param {Event} event - Browser event.
*/
'focus': (event: Event) => void;
/**
* Callback to invoke when the component loses focus.
* @param {Event} event - Browser event.
*/
'blur': (event: Event) => void;
/**
* Callback to invoke before the overlay is shown.
*/
@ -369,12 +423,18 @@ export declare type MultiSelectEmits = {
declare class MultiSelect extends ClassComponent<MultiSelectProps, MultiSelectSlots, MultiSelectEmits> {
/**
* Shows the overlay.
* @param {boolean} [isFocus] - Decides whether to focus on the component. Default value is false.
*
* @memberof MultiSelect
*/
show: () => void;
show: (isFocus?: boolean) => void;
/**
* Hides the overlay.
* @param {boolean} [isFocus] - Decides whether to focus on the component. Default value is false.
*
* @memberof MultiSelect
*/
hide: () => void;
hide: (isFocus?: boolean) => void;
}
declare module '@vue/runtime-core' {

File diff suppressed because it is too large Load Diff

View File

@ -128,7 +128,7 @@ export default {
</code></pre>
<h5>Properties</h5>
<p>Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.</p>
<p>Any property of HTMLDivElement are passed to the main container element. Following are the additional properties to configure the component.</p>
<div class="doc-tablewrapper">
<table class="doc-table">
<thead>
@ -188,6 +188,66 @@ export default {
<td>200px</td>
<td>Height of the viewport, a scrollbar is defined if height of list exceeds this value.</td>
</tr>
<tr>
<td>placeholder</td>
<td>string</td>
<td>null</td>
<td>Label to display when there are no selections.</td>
</tr>
<tr>
<td>disabled</td>
<td>boolean</td>
<td>false</td>
<td>When present, it specifies that the component should be disabled.</td>
</tr>
<tr>
<td>inputId</td>
<td>string</td>
<td>null</td>
<td>Identifier of the underlying input element.</td>
</tr>
<tr>
<td>inputProps</td>
<td>object</td>
<td>null</td>
<td>Uses to pass all properties of the HTMLInputElement to the focusable input element inside the component.</td>
</tr>
<tr>
<td>panelStyle</td>
<td>any</td>
<td>null</td>
<td>Inline style of the overlay panel.</td>
</tr>
<tr>
<td>panelClass</td>
<td>string</td>
<td>null</td>
<td>Style class of the overlay panel.</td>
</tr>
<tr>
<td>panelProps</td>
<td>object</td>
<td>null</td>
<td>Uses to pass all properties of the HTMLDivElement to the overlay panel.</td>
</tr>
<tr>
<td>filterInputProps</td>
<td>object</td>
<td>null</td>
<td>Uses to pass all properties of the HTMLInputElement to the filter input inside the overlay panel.</td>
</tr>
<tr>
<td>closeButtonProps</td>
<td>object</td>
<td>null</td>
<td>Uses to pass all properties of the HTMLButtonElement to the close button inside the overlay panel.</td>
</tr>
<tr>
<td>dataKey</td>
<td>string</td>
<td>null</td>
<td>A property to uniquely identify an option.</td>
</tr>
<tr>
<td>filter</td>
<td>boolean</td>
@ -218,42 +278,6 @@ export default {
<td>null</td>
<td>Fields used when filtering the options, defaults to optionLabel.</td>
</tr>
<tr>
<td>placeholder</td>
<td>string</td>
<td>null</td>
<td>Label to display when there are no selections.</td>
</tr>
<tr>
<td>disabled</td>
<td>boolean</td>
<td>false</td>
<td>When present, it specifies that the component should be disabled.</td>
</tr>
<tr>
<td>tabindex</td>
<td>string</td>
<td>null</td>
<td>Index of the element in tabbing order.</td>
</tr>
<tr>
<td>inputId</td>
<td>string</td>
<td>null</td>
<td>Identifier of the underlying input element.</td>
</tr>
<tr>
<td>dataKey</td>
<td>string</td>
<td>null</td>
<td>A property to uniquely identify an option.</td>
</tr>
<tr>
<td>ariaLabelledBy</td>
<td>string</td>
<td>null</td>
<td>Establishes relationships between the component and label(s) where its value should be one or more element IDs.</td>
</tr>
<tr>
<td>appendTo</td>
<td>string</td>
@ -261,18 +285,6 @@ export default {
<td>A valid query selector or an HTMLElement to specify where the overlay gets attached. Special keywords are "body" for document body
and "self" for the element itself.</td>
</tr>
<tr>
<td>emptyFilterMessage</td>
<td>string</td>
<td>No results found</td>
<td>Text to display when filtering does not return any results. Defaults to value from PrimeVue locale configuration.</td>
</tr>
<tr>
<td>emptyMessage</td>
<td>string</td>
<td>No results found</td>
<td>Text to display when there are no options available. Defaults to value from PrimeVue locale configuration.</td>
</tr>
<tr>
<td>display</td>
<td>string</td>
@ -280,10 +292,16 @@ export default {
<td>Defines how the selected items are displayed, valid values are "comma" and "chip".</td>
</tr>
<tr>
<td>panelClass</td>
<td>selectedItemsLabel</td>
<td>string</td>
<td>&#123;0&#125; items selected</td>
<td>Label to display after exceeding max selected labels.</td>
</tr>
<tr>
<td>maxSelectedLabels</td>
<td>number</td>
<td>null</td>
<td>Style class of the overlay panel.</td>
<td>Decides how many selected item labels to show at most.</td>
</tr>
<tr>
<td>selectionLimit</td>
@ -309,18 +327,6 @@ export default {
<td>pi pi-spinner pi-spin</td>
<td>Icon to display in loading state.</td>
</tr>
<tr>
<td>maxSelectedLabels</td>
<td>number</td>
<td>null</td>
<td>Decides how many selected item labels to show at most.</td>
</tr>
<tr>
<td>selectedItemsLabel</td>
<td>string</td>
<td>&#123;0&#125; items selected</td>
<td>Label to display after exceeding max selected labels.</td>
</tr>
<tr>
<td>selectAll</td>
<td>boolean</td>
@ -338,6 +344,60 @@ export default {
<td>object</td>
<td>null</td>
<td>Whether to use the virtualScroller feature. The properties of <router-link to="/virtualscroller">VirtualScroller</router-link> component can be used like an object in it.</td>
</tr>
<tr>
<td>autoOptionFocus</td>
<td>boolean</td>
<td>true</td>
<td>Whether to focus on the first visible or selected element when the overlay panel is shown.</td>
</tr>
<tr>
<td>filterMessage</td>
<td>string</td>
<td>{0} results are available</td>
<td>Text to be displayed in hidden accessible field when filtering returns any results. Defaults to value from PrimeVue locale configuration.</td>
</tr>
<tr>
<td>selectionMessage</td>
<td>string</td>
<td>{0} items selected</td>
<td>Text to be displayed in hidden accessible field when options are selected. Defaults to value from PrimeVue locale configuration.</td>
</tr>
<tr>
<td>emptySelectionMessage</td>
<td>string</td>
<td>No selected item</td>
<td>Text to be displayed in hidden accessible field when any option is not selected. Defaults to value from PrimeVue locale configuration.</td>
</tr>
<tr>
<td>emptyFilterMessage</td>
<td>string</td>
<td>No results found</td>
<td>Text to be displayed when filtering does not return any results. Defaults to value from PrimeVue locale configuration.</td>
</tr>
<tr>
<td>emptyMessage</td>
<td>string</td>
<td>No results found</td>
<td>Text to be displayed when there are no options available. Defaults to value from PrimeVue locale configuration.</td>
</tr>
<tr>
<td>tabindex</td>
<td>number</td>
<td>0</td>
<td>Index of the element in tabbing order.</td>
</tr>
<tr>
<td>ariaLabel</td>
<td>string</td>
<td>null</td>
<td>Defines a string value that labels an interactive element.</td>
</tr>
<tr>
<td>ariaLabelledby</td>
<td>string</td>
<td>null</td>
<td>Establishes relationships between the component and label(s) where its value should be one or more element IDs.</td>
</tr>
</tbody>
</table>
@ -360,6 +420,16 @@ export default {
event.value: Selected option value </td>
<td>Callback to invoke on value change.</td>
</tr>
<tr>
<td>focus</td>
<td>event</td>
<td>Callback to invoke when the component receives focus.</td>
</tr>
<tr>
<td>blur</td>
<td>event</td>
<td>Callback to invoke when the component loses focus.</td>
</tr>
<tr>
<td>before-show</td>
<td>-</td>
@ -409,12 +479,12 @@ export default {
<tbody>
<tr>
<td>show</td>
<td>-</td>
<td>isFocus: Decides whether to focus on the component. Default value is false.</td>
<td>Shows the overlay.</td>
</tr>
<tr>
<td>hide</td>
<td>-</td>
<td>isFocus: Decides whether to focus on the component. Default value is false.</td>
<td>Hides the overlay.</td>
</tr>
<tr>
@ -436,21 +506,19 @@ export default {
</tr>
</thead>
<tbody>
<tr>
<td>option</td>
<td>option: Option instance <br />
index: Index of the option</td>
</tr>
<tr>
<td>optiongroup</td>
<td>option: OptionGroup instance <br />
index: Index of the option group</td>
</tr>
<tr>
<td>value</td>
<td>value: Value of the component <br />
placeholder: Placeholder prop value</td>
</tr>
<tr>
<td>chip</td>
<td>value: A value in the selection</td>
</tr>
<tr>
<td>indicator</td>
<td>-</td>
</tr>
<tr>
<td>header</td>
<td>value: Value of the component <br />
@ -461,6 +529,16 @@ export default {
<td>value: Value of the component <br />
options: Displayed options</td>
</tr>
<tr>
<td>option</td>
<td>option: Option instance <br />
index: Index of the option</td>
</tr>
<tr>
<td>optiongroup</td>
<td>option: OptionGroup instance <br />
index: Index of the option group</td>
</tr>
<tr>
<td>emptyfilter</td>
<td>-</td>
@ -469,10 +547,6 @@ export default {
<td>empty</td>
<td>-</td>
</tr>
<tr>
<td>chip</td>
<td>value: A value in the selection</td>
</tr>
<tr>
<td>content</td>
<td>items: An array of objects to display for virtualscroller<br />
@ -483,10 +557,6 @@ export default {
<tr>
<td>loader</td>
<td>options: Options of the loader items for virtualscroller</td>
</tr>
<tr>
<td>indicator</td>
<td>-</td>
</tr>
</tbody>
</table>
@ -534,11 +604,260 @@ export default {
<tr>
<td>p-multiselect-item</td>
<td>An item in the list.</td>
</tr>
<tr>
<td>p-overlay-open</td>
<td>Container element when overlay is visible.</td>
</tr>
</tbody>
</table>
</div>
<h5>Accessibility</h5>
<h6>Screen Reader</h6>
<p>Value to describe the component can either be provided with <i>aria-labelledby</i> or <i>aria-label</i> props. The multiselect component has a <i>combobox</i> role
in addition to <i>aria-haspopup</i> and <i>aria-expanded</i> attributes. The relation between the combobox and the popup is created with <i>aria-controls</i> attribute that refers to the id of the popup listbox.</p>
<p>The popup listbox uses <i>listbox</i> as the role with <i>aria-multiselectable</i> enabled. Each list item has an <i>option</i> role along with <i>aria-label</i>, <i>aria-selected</i> and <i>aria-disabled</i> attributes.</p>
<p>Checkbox component at the header uses a hidden native checkbox element internally that is only visible to screen readers. Value to read is defined with the <i>selectAll</i> and <i>unselectAll</i> keys of the <i>aria</i> property from the <router-link to="/locale">locale</router-link> API.</p>
<p>If filtering is enabled, <i>filterInputProps</i> can be defined to give <i>aria-*</i> props to the input element.</p>
<p>Close button uses <i>close</i> key of the <i>aria</i> property from the <router-link to="/locale">locale</router-link> API as the <i>aria-label</i> by default, this can be overriden with the <i>closeButtonProps</i>.</p>
<pre v-code><code>
&lt;span id="dd1"&gt;Options&lt;/span&gt;
&lt;MultiSelect aria-labelledby="dd1" /&gt;
&lt;MultiSelect aria-label="Options" /&gt;
</code></pre>
<h6>Closed State Keyboard Support</h6>
<div className="doc-tablewrapper">
<table className="doc-table">
<thead>
<tr>
<th>Key</th>
<th>Function</th>
</tr>
</thead>
<tbody>
<tr>
<td><i>tab</i></td>
<td>Moves focus to the multiselect element.</td>
</tr>
<tr>
<td><i>space</i></td>
<td>Opens the popup and moves visual focus to the selected option, if there is none then first option receives the focus.</td>
</tr>
<tr>
<td><i>enter</i></td>
<td>Opens the popup and moves visual focus to the selected option, if there is none then first option receives the focus.</td>
</tr>
<tr>
<td><i>down arrow</i></td>
<td>Opens the popup and moves visual focus to the selected option, if there is none then first option receives the focus.</td>
</tr>
<tr>
<td><i>up arrow</i></td>
<td>Opens the popup and moves visual focus to the selected option, if there is none then first option receives the focus.</td>
</tr>
<tr>
<td><i>any printable character</i></td>
<td>Opens the popup and moves focus to the option whose label starts with the characters being typed, if there is none then first option receives the focus.</td>
</tr>
</tbody>
</table>
</div>
<h6>Popup Keyboard Support</h6>
<div className="doc-tablewrapper">
<table className="doc-table">
<thead>
<tr>
<th>Key</th>
<th>Function</th>
</tr>
</thead>
<tbody>
<tr>
<td><i>tab</i></td>
<td>Moves focus to the next focusable element in the popup, if there is none then first focusable element receives the focus.</td>
</tr>
<tr>
<td><i>shift</i> + <i>tab</i></td>
<td>Moves focus to the previous focusable element in the popup, if there is none then last focusable element receives the focus.</td>
</tr>
<tr>
<td><i>enter</i></td>
<td>Toggles the selection state of the focused option, then moves focus to the multiselect element.</td>
</tr>
<tr>
<td><i>space</i></td>
<td>Toggles the selection state of the focused option, then moves focus to the multiselect element.</td>
</tr>
<tr>
<td><i>escape</i></td>
<td>Closes the popup, moves focus to the multiselect element.</td>
</tr>
<tr>
<td><i>down arrow</i></td>
<td>Moves focus to the next option, if there is none then visual focus does not change.</td>
</tr>
<tr>
<td><i>up arrow</i></td>
<td>Moves focus to the previous option, if there is none then visual focus does not change.</td>
</tr>
<tr>
<td><i>alt</i> + <i>up arrow</i></td>
<td>Selects the focused option and closes the popup, then moves focus to the multiselect element.</td>
</tr>
<tr>
<td><i>shift</i> + <i>down arrow</i></td>
<td>Moves focus to the next option and toggles the selection state.</td>
</tr>
<tr>
<td><i>shift</i> + <i>up arrow</i></td>
<td>Moves focus to the previous option and toggles the selection state.</td>
</tr>
<tr>
<td><i>shift</i> + <i>space</i></td>
<td>Selects the items between the most recently selected option and the focused option.</td>
</tr>
<tr>
<td><i>home</i></td>
<td>Moves focus to the first option.</td>
</tr>
<tr>
<td><i>end</i></td>
<td>Moves focus to the last option.</td>
</tr>
<tr>
<td><i>control</i> + <i>shift</i> + <i>home</i></td>
<td>Selects the focused options and all the options up to the first one.</td>
</tr>
<tr>
<td><i>control</i> + <i>shift</i> + <i>end</i></td>
<td>Selects the focused options and all the options down to the last one.</td>
</tr>
<tr>
<td><i>control</i> + <i>a</i></td>
<td>Selects all options.</td>
</tr>
<tr>
<td><i>pageUp</i></td>
<td>Jumps visual focus to first option.</td>
</tr>
<tr>
<td><i>pageDown</i></td>
<td>Jumps visual focus to last option.</td>
</tr>
<tr>
<td><i>any printable character</i></td>
<td>Moves focus to the option whose label starts with the characters being typed.</td>
</tr>
</tbody>
</table>
</div>
<h6>Toggle All Checkbox Keyboard Support</h6>
<div className="doc-tablewrapper">
<table className="doc-table">
<thead>
<tr>
<th>Key</th>
<th>Function</th>
</tr>
</thead>
<tbody>
<tr>
<td><i>space</i></td>
<td>Toggles the checked state.</td>
</tr>
<tr>
<td><i>escape</i></td>
<td>Closes the popup and moves focus to the multiselect element.</td>
</tr>
</tbody>
</table>
</div>
<h6>Filter Input Keyboard Support</h6>
<div className="doc-tablewrapper">
<table className="doc-table">
<thead>
<tr>
<th>Key</th>
<th>Function</th>
</tr>
</thead>
<tbody>
<tr>
<td><i>down arrow</i></td>
<td>Moves focus to the next option, if there is none then visual focus does not change.</td>
</tr>
<tr>
<td><i>up arrow</i></td>
<td>Moves focus to the previous option, if there is none then visual focus does not change.</td>
</tr>
<tr>
<td><i>left arrow</i></td>
<td>Removes the visual focus from the current option and moves input cursor to one character left.</td>
</tr>
<tr>
<td><i>right arrow</i></td>
<td>Removes the visual focus from the current option and moves input cursor to one character right.</td>
</tr>
<tr>
<td><i>home</i></td>
<td>Moves input cursor at the end, if not then moves focus to the first option.</td>
</tr>
<tr>
<td><i>end</i></td>
<td>Moves input cursor at the beginning, if not then moves focus to the last option.</td>
</tr>
<tr>
<td><i>enter</i></td>
<td>Closes the popup and moves focus to the multiselect element.</td>
</tr>
<tr>
<td><i>escape</i></td>
<td>Closes the popup and moves focus to the multiselect element.</td>
</tr>
<tr>
<td><i>tab</i></td>
<td>Moves focus to the next focusable element in the popup. If there is none, the focusable option is selected and the overlay is closed then moves focus to next element in page.</td>
</tr>
</tbody>
</table>
</div>
<h6>Close Button Keyboard Support</h6>
<div className="doc-tablewrapper">
<table className="doc-table">
<thead>
<tr>
<th>Key</th>
<th>Function</th>
</tr>
</thead>
<tbody>
<tr>
<td><i>enter</i></td>
<td>Closes the popup and moves focus to the multiselect element.</td>
</tr>
<tr>
<td><i>space</i></td>
<td>Closes the popup and moves focus to the multiselect element.</td>
</tr>
<tr>
<td><i>escape</i></td>
<td>Closes the popup and moves focus to the multiselect element.</td>
</tr>
</tbody>
</table>
</div>
<h5>Dependencies</h5>
<p>None.</p>
</AppDoc>