@keenmate/web-multiselect 1.12.0-rc02 → 1.12.0-rc03

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,84 @@
1
+ # Accessibility
2
+
3
+ This component is designed to be navigable from the keyboard alone and to work with assistive technologies via standard HTML semantics. This document covers what's currently shipped — keyboard model, ARIA labels, focus behavior — and any known gaps.
4
+
5
+ ## Keyboard shortcuts
6
+
7
+ | Key | Action |
8
+ |-----|--------|
9
+ | **↑ / ↓** | Navigate up/down through options |
10
+ | **Ctrl + ↑ / Ctrl + ↓** | Jump between matched items (navigate mode only) |
11
+ | **Page Up / Page Down** | Move focus by 10 options at a time |
12
+ | **Home / End** | Jump to first / last option |
13
+ | **Enter** | Select focused option (or add new entry when `allow-add-new="true"` and the search has text) |
14
+ | **Escape** | Close popover → clear search → close dropdown (priority order) |
15
+ | **Tab** | Close dropdown and move to next field |
16
+ | **Type** | Filter options by search term |
17
+
18
+ > 💡 To surface these shortcuts to your users, set the `search-hint` attribute — the hint floats above the input when focused. Example:
19
+ >
20
+ > ```html
21
+ > <web-multiselect
22
+ > search-mode="navigate"
23
+ > search-hint="Ctrl/Cmd + ↓ / ↑ to jump between matches">
24
+ > </web-multiselect>
25
+ > ```
26
+
27
+ ## ARIA labels
28
+
29
+ The component ships labels on every interactive control:
30
+
31
+ | Control | Label | Source |
32
+ |---------|-------|--------|
33
+ | Per-badge remove button | `Remove {item display value}` | `getRemoveButtonTooltipCallback` or `removeButtonTooltipText` (with `{0}` placeholder); default `"Remove {name}"` |
34
+ | Hidden-items remove badge (partial mode "+N more") | `Remove {N} hidden items` | Built-in |
35
+ | Clear-all badge (count mode) | `Clear all selections` | Built-in |
36
+ | Selected-items popover close | `Close` | Built-in |
37
+
38
+ Custom remove-button labels via the `getRemoveButtonTooltipCallback`:
39
+
40
+ ```javascript
41
+ multiselect.getRemoveButtonTooltipCallback = (option) => {
42
+ return `Unassign ${option.name} from this task`;
43
+ };
44
+ ```
45
+
46
+ Or via attribute, with `{0}` as the item name placeholder:
47
+
48
+ ```html
49
+ <web-multiselect remove-button-tooltip-text="Unassign {0}"></web-multiselect>
50
+ ```
51
+
52
+ ## Focus & input behavior
53
+
54
+ - Opening the dropdown moves DOM focus to the search input.
55
+ - Arrow-key navigation moves a *visual* focus indicator through options without moving DOM focus — the search input stays focused so typing continues to filter.
56
+ - **Escape** behaves in priority order: close the selected-items popover (if open) → clear the search text (if any) → close the dropdown.
57
+ - **Tab** closes the dropdown and moves DOM focus to the next focusable element in the page, matching native `<select>` semantics.
58
+ - Disabled options are skipped during keyboard navigation.
59
+
60
+ ## Form integration & screen readers
61
+
62
+ When the `name` attribute is set, the component creates hidden inputs in the **light DOM** (outside the shadow root) for form submission. This means:
63
+
64
+ - Standard `<label for="…">` linking to a wrapping `<form>` or sibling label works as expected.
65
+ - Form validation events (`invalid`, `change`) propagate to the host element.
66
+ - Screen readers that announce form controls will see the hidden inputs.
67
+
68
+ For best results, wrap the component with a `<label>` so the label's text becomes the accessible name:
69
+
70
+ ```html
71
+ <label>
72
+ Pick your skills
73
+ <web-multiselect name="skills"></web-multiselect>
74
+ </label>
75
+ ```
76
+
77
+ ## Known gaps
78
+
79
+ The component does **not** currently declare a `role="combobox"` /`role="listbox"` / `aria-expanded` / `aria-activedescendant` ARIA combobox pattern on the host. Screen-reader announcements rely on the labels above and on the underlying form integration. If you need the formal combobox pattern (e.g. for WCAG 2.2 AAA compliance), please open an issue on the GitHub repo with your use case.
80
+
81
+ ## See also
82
+
83
+ - [Keyboard shortcuts as a search hint](./usage.md#attributes) — `search-hint` attribute reference.
84
+ - [`examples-classic.html`](../examples-classic.html) — interactive demos including focus behavior.