You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/select.md
+61-2
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ import EncapsulationPill from '@components/page/api/EncapsulationPill';
18
18
<EncapsulationPilltype="shadow" />
19
19
20
20
21
-
Selects are form controls to select an option, or options, from a set of options, similar to a native `<select>` element. When a user taps the select, a dialog appears with all of the options in a large, easy to select list.
21
+
Selects are form controls to select an option, or options, from a set of options. When a user taps the select, a dialog appears with all of the options in a large, easy to select list.
22
22
23
23
A select should be used with child `<ion-select-option>` elements. If the child option is not given a `value` attribute then its text will be used as the value.
24
24
@@ -62,6 +62,8 @@ import NoVisibleLabel from '@site/static/usage/v7/select/no-visible-label/index.
62
62
63
63
By default, the select allows the user to select only one option. The alert interface presents users with a radio button styled list of options. The select component's value receives the value of the selected option's value.
64
64
65
+
Keyboard interactions for single selection are described in the [Keyboard Interactions](#single-selection-1) section below.
66
+
65
67
import SingleSelectionExample from '@site/static/usage/v7/select/basic/single-selection/index.md';
66
68
67
69
<SingleSelectionExample />
@@ -70,7 +72,13 @@ import SingleSelectionExample from '@site/static/usage/v7/select/basic/single-se
70
72
71
73
By adding the `multiple` attribute to select, users are able to select multiple options. When multiple options can be selected, the alert or popover overlay presents users with a checkbox styled list of options. The select component's value receives an array of all of the selected option values.
72
74
73
-
Note: the `action-sheet` interface will not work with multiple selection.
75
+
:::note
76
+
77
+
The `action-sheet` interface is not supported with multiple selection.
78
+
79
+
:::
80
+
81
+
Keyboard interactions for multiple selection are described in the [Keyboard Interactions](#multiple-selection-1) section below.
74
82
75
83
import MultipleSelectionExample from '@site/static/usage/v7/select/basic/multiple-selection/index.md';
76
84
@@ -86,6 +94,7 @@ import AlertExample from '@site/static/usage/v7/select/basic/single-selection/in
86
94
87
95
<AlertExample />
88
96
97
+
89
98
### Action Sheet
90
99
91
100
import ActionSheetExample from '@site/static/usage/v7/select/interfaces/action-sheet/index.md';
@@ -257,6 +266,56 @@ import Migration from '@site/static/usage/v7/select/migration/index.md';
257
266
258
267
Ionic uses heuristics to detect if an app is using the modern select syntax. In some instances, it may be preferable to continue using the legacy syntax. Developers can set the `legacy` property on `ion-select` to `true` to force that instance of the input to use the legacy syntax.
259
268
269
+
## Accessibility
270
+
271
+
### Keyboard Interactions
272
+
273
+
Ionic's keyboard interactions follow the implementation patterns of the web instead of the native iOS select for a consistent experience across all platforms.
274
+
275
+
These keyboard interactions apply to all `ion-select` elements when the following conditions are met:
276
+
- The select is closed.
277
+
- The select is focused.
278
+
- The select is not disabled.
279
+
280
+
|Key|Description|
281
+
|----|----|
282
+
|<kbd>Enter</kbd>|Opens the overlay and focuses on the first selected option. If there is no selected option, then it focuses on the first option.|
283
+
|<kbd>Space</kbd>|Opens the overlay and focuses on the first selected option. If there is no selected option, then it focuses on the first option.|
284
+
285
+
286
+
#### Single Selection
287
+
288
+
Single selection keyboard interaction follows the [ARIA implementation patterns of a radio](https://www.w3.org/WAI/ARIA/apg/patterns/radio/).
289
+
290
+
291
+
These keyboard interactions apply to `ion-action-sheet`, `ion-alert`, and `ion-popover` elements when the overlay is presented and focused.
292
+
293
+
|Key|Description|
294
+
|----|----|
295
+
|<kbd>ArrowDown</kbd>|Focuses and selects the next option in the list. If there is no next option, selection will cycle to the first option.|
296
+
|<kbd>ArrowLeft</kbd>|Focuses and selects the previous option in the list. If there is no previous option, selection will cycle to the last option.|
297
+
|<kbd>ArrowRight</kbd>|Focuses and selects the next option in the list. If there is no next option, selection will cycle to the first option.|
298
+
|<kbd>ArrowUp</kbd>|Focuses and selects the previous option in the list. If there is no previous option, selection will cycle to the last option.|
299
+
|<kbd>Enter</kbd>|If an option is focused, it will select the option. Overlays **without** an 'OK' button will commit the value immediately, dismiss the overlay and return focus to the `ion-select` element.<br /><br/>If the 'OK' button is focused, it will save the user's selection, dismiss the overlay and return focus to the `ion-select` element.|
300
+
|<kbd>Escape</kbd>|Closes the overlay without changing the submitted option. Returns the focus back to the `ion-select` element.|
301
+
|<kbd>Space</kbd>|If the focused radio button is not checked, unchecks the currently checked radio button and checks the focused radio button. Otherwise, does nothing. If the overlay does not have an 'OK' button, the value will be committed immediately and the overlay will dismiss.|
302
+
|<kbd>Tab</kbd>|Moves focus to the next focusable element (cancel button, 'OK' button, or either the selection or the first option) on the overlay. If the next focusable element is an option, then it will focus on the selected option, otherwise it will focus the first option.|
303
+
304
+
305
+
306
+
#### Multiple Selection
307
+
308
+
Multiple selection keyboard interaction follows the [ARIA implementation patterns of a checkbox](https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/).
309
+
310
+
These keyboard interactions apply to `ion-alert` and `ion-popover` elements when the overlay is presented and multiple selection is enabled.
311
+
312
+
|Key|Description|
313
+
|----|----|
314
+
|<kbd>Enter</kbd>|When the 'OK' button is focused, it will save the user's selection, dismiss the overlay, and return focus to the `ion-select` element.|
315
+
|<kbd>Escape</kbd>|Closes the overlay without changing the submitted option(s). Returns the focus back to the `ion-select` element.|
316
+
|<kbd>Space</kbd>|Selects or deselects the currently focused option. This does not deselect the other selected options. If the overlay does not have an 'OK' button, the value will be committed immediately.|
317
+
|<kbd>Tab</kbd>|Move focus to the next focusable element (cancel button, 'OK' button, or any of the options) on the overlay. If the next focusable element is the options list, then it should iterate through each option.|
0 commit comments