primevue-mirror/doc/listbox/AccessibilityDoc.vue

158 lines
6.7 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText id="accessibility" label="Accessibility" v-bind="$attrs">
<h3>Screen Reader</h3>
<p>
Value to describe the component can be provided <i>aria-labelledby</i> or <i>aria-label</i> props. The list element has a <i>listbox</i> role with the <i>aria-multiselectable</i> attribute that sets to true when multiple selection is
enabled. Each list item has an <i>option</i> role with <i>aria-selected</i> and <i>aria-disabled</i> as their attributes.
</p>
<p>If filtering is enabled, <i>filterInputProps</i> can be defined to give <i>aria-*</i> props to the input element. Alternatively <i>filterPlaceholder</i> is usually utilized by the screen readers as well.</p>
2024-01-30 08:16:35 +00:00
<DocSectionCode :code="code" hideToggleCode hideStackBlitz v-bind="$attrs" />
2023-02-28 08:29:30 +00:00
<h3>Keyboard Support</h3>
<div class="doc-tablewrapper">
<table class="doc-table">
<thead>
<tr>
<th>Key</th>
<th>Function</th>
</tr>
</thead>
<tbody>
<tr>
<td><i>tab</i></td>
<td>Moves focus to the first selected option, if there is none then first option receives the focus.</td>
</tr>
<tr>
<td><i>up arrow</i></td>
<td>Moves focus to the previous option.</td>
</tr>
<tr>
<td><i>down arrow</i></td>
<td>Moves focus to the next option.</td>
</tr>
<tr>
<td><i>enter</i></td>
<td>Toggles the selected state of the focused option.</td>
</tr>
<tr>
<td><i>space</i></td>
<td>Toggles the selected state of 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>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>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>
<h3>Filter Input Keyboard Support</h3>
<div class="doc-tablewrapper">
<table class="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 component. If there is none, moves focus to next element in page.</td>
</tr>
</tbody>
</table>
</div>
</DocSectionText>
</template>
<script>
export default {
data() {
return {
code: {
2023-09-22 12:54:14 +00:00
basic: `
<span id="lb"></span>Options</span>
2023-02-28 08:29:30 +00:00
<Listbox aria-labelledby="lb" />
2023-10-15 09:38:39 +00:00
<Listbox aria-label="City" />
`
2023-02-28 08:29:30 +00:00
}
};
}
};
</script>