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
+29-38
Original file line number
Diff line number
Diff line change
@@ -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 />
@@ -72,6 +74,8 @@ By adding the `multiple` attribute to select, users are able to select multiple
72
74
73
75
Note: the `action-sheet` interface will not work with multiple selection.
74
76
77
+
Keyboard interactions for multiple selection are described in the [Keyboard Interactions](#multiple-selection-1) section below.
78
+
75
79
import MultipleSelectionExample from '@site/static/usage/v7/select/basic/multiple-selection/index.md';
76
80
77
81
<MultipleSelectionExample />
@@ -82,25 +86,19 @@ By default, select uses [ion-alert](alert.md) to open up the overlay of options
82
86
83
87
### Alert
84
88
85
-
Keyboard interactions for the `alert` interface are described in the [Keyboard Interactions](#interface-alert) section below.
86
-
87
89
import AlertExample from '@site/static/usage/v7/select/basic/single-selection/index.md';
88
90
89
91
<AlertExample />
90
92
91
93
92
94
### Action Sheet
93
95
94
-
Keyboard interactions for the `action-sheet` interface are described in the [Keyboard Interactions](#interface-action-sheet) section below.
95
-
96
96
import ActionSheetExample from '@site/static/usage/v7/select/interfaces/action-sheet/index.md';
97
97
98
98
<ActionSheetExample />
99
99
100
100
### Popover
101
101
102
-
Keyboard interactions for the `popover` interface are described in the [Keyboard Interactions](#interface-popover) section below.
103
-
104
102
import PopoverExample from '@site/static/usage/v7/select/interfaces/popover/index.md';
105
103
106
104
<PopoverExample />
@@ -268,58 +266,51 @@ Ionic uses heuristics to detect if an app is using the modern select syntax. In
268
266
269
267
### Keyboard Interactions
270
268
271
-
Ionic's keyboard interactions follow the implementation patterns of the web `<select>` instead of the native iOS select for a consistent experience across all platforms. The following sections describe the keyboard interactions for the different interfaces.
269
+
Ionic's keyboard interactions follow the implementation patterns of the web `<select>` instead of the native iOS select for a consistent experience across all platforms.
272
270
273
-
These keyboard interactions apply to the`ion-select` when the following conditions are met:
271
+
These keyboard interactions apply to all`ion-select` when the following conditions are met:
274
272
- The select is closed.
275
273
- The select is focused.
276
274
- The select is not disabled.
277
275
278
276
|Key|Description|
279
277
|----|----|
280
-
|<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.|
281
278
|<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.|
279
+
|<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.|
282
280
283
-
#### Interface: Alert
284
281
285
-
These keyboard interactions apply to the `ion-alert` dialog when the overlay is presented and focused.
282
+
#### Single Selection
286
283
287
-
|Key|Description|
288
-
|----|----|
289
-
|<kbd>Space</kbd>|[**Single selection**](#single-selection): If the currently focused option is not selected, then it will become selected. <br /> <br /> [**Multiple selection**](#multiple-selection): Selects or deselects the currently focused option. This does not deselect the other selected options. |
290
-
|<kbd>ArrowUp</kbd>|[**Single selection**](#single-selection): Focuses and selects the previous option in the list. If there is no previous option, selection will cycle to the last option.|
291
-
|<kbd>ArrowLeft</kbd>|[**Single selection**](#single-selection): Focuses and selects the previous option in the list. If there is no previous option, selection will cycle to the last option.|
292
-
|<kbd>ArrowDown</kbd>|[**Single selection**](#single-selection): Focuses and selects the next option in the list. If there is no next option, selection will cycle to the first option.|
293
-
|<kbd>ArrowRight</kbd>|[**Single selection**](#single-selection): Focuses and selects the next option in the list. If there is no next option, selection will cycle to the first option.|
294
-
|<kbd>Tab</kbd>|[**Single selection**](#single-selection): 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.<br /><br />[**Multiple selection**](#multiple-selection): 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.|
295
-
|<kbd>Enter</kbd>|[**Single selection**](#single-selection): With the ok button focused or an option selected, will save the user's selection, dismiss the overlay and move focus back to the select.<br /><br/>[**Multiple selection**](#multiple-selection): With the ok button focused, will save the user's selection, dismiss the overlay and move focus back to the select.|
296
-
|<kbd>Escape</kbd>|Closes the overlay without changing the submitted option(s). Moves the focus back to the select.|
284
+
Single selection keyboard interaction follows the [ARIA implementation patterns of a radio](https://www.w3.org/WAI/ARIA/apg/patterns/radio/).
297
285
298
-
#### Interface: Action Sheet
299
286
300
-
These keyboard interactions apply to the [`ion-action-sheet` dialog](#action-sheet) when the overlay is presented and focused.
287
+
These keyboard interactions apply to `ion-action-sheet`, `ion-alert`, and `ion-popover` dialogs when the overlay is presented and focused.
301
288
302
289
|Key|Description|
303
-
|---|----|
290
+
|----|----|
291
+
|<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.|
292
+
|<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.|
293
+
|<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.|
294
+
|<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.|
295
+
|<kbd>Enter</kbd>|With the ok button focused or an option selected, will save the user's selection, dismiss the overlay and move focus back to the select.|
304
296
|<kbd>Escape</kbd>|Closes the overlay without changing the submitted option. Moves the focus back to the select.|
305
-
|<kbd>Tab</kbd>|Moves focus to the next focusable element (cancel button or options) on the overlay. If the next focusable element is the options list, then it should iterate through each option.|
306
-
|<kbd>Enter</kbd>|Submits the currently selected option, closes the overlay, and moves focus back to the select.|
307
-
|<kbd>Space</kbd>|Submits the currently focused option, closes the overlay, and moves focus back to the select.|
297
+
|<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.|
298
+
|<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.|
308
299
309
-
#### Interface: Popover
310
300
311
-
These keyboard interactions apply to the [`ion-popover` dialog](#popover) when the overlay is presented and focused.
312
301
313
-
|Key|Description|
314
-
|---|----|
315
-
|<kbd>Escape</kbd>|Closes the overlay without changing the selected option.|
316
-
|<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.|
317
-
|<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.|
318
-
|<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.|
319
-
|<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.|
320
-
|<kbd>Space</kbd>|[**Single selection**](#single-selection): Submits the currently selected option and closes the overlay.<br /><br/>[**Multiple selection**](#multiple-selection): Selects or deselects the currently focused option. This does not deselect the other selected options. The selected option is automatically submitted.|
321
-
|<kbd>Tab</kbd>|[**Single selection**](#single-selection): Focuses on the select and keeps the overlay open. It does not tab through the options.<br /><br />[**Multiple selection**](#multiple-selection): Moves focus to the next focusable element (the options or the select). The order will be option and then select. If the next focusable element is the options list, then it should iterate through each option.|
302
+
#### Multiple Selection
303
+
304
+
Multiple selection keyboard interaction follows the [ARIA implementation patterns of a checkbox](https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/).
305
+
306
+
These keyboard interactions apply to `ion-alert` and `ion-popover` dialogs when the overlay is presented and multiple selection is enabled.
322
307
308
+
|Key|Description|
309
+
|----|----|
310
+
|<kbd>Enter</kbd>|With the ok button focused, will save the user's selection, dismiss the overlay and move focus back to the select.|
311
+
|<kbd>Escape</kbd>|Closes the overlay without changing the submitted option(s). Moves the focus back to the select.|
312
+
|<kbd>Space</kbd>|Selects or deselects the currently focused option. This does not deselect the other selected options.|
313
+
|<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