Skip to content

Commit 7d89260

Browse files
committed
docs: restructure sections
1 parent cfe2f32 commit 7d89260

File tree

1 file changed

+29
-38
lines changed

1 file changed

+29
-38
lines changed

docs/api/select.md

+29-38
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ import NoVisibleLabel from '@site/static/usage/v7/select/no-visible-label/index.
6262

6363
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.
6464

65+
Keyboard interactions for single selection are described in the [Keyboard Interactions](#single-selection-1) section below.
66+
6567
import SingleSelectionExample from '@site/static/usage/v7/select/basic/single-selection/index.md';
6668

6769
<SingleSelectionExample />
@@ -72,6 +74,8 @@ By adding the `multiple` attribute to select, users are able to select multiple
7274

7375
Note: the `action-sheet` interface will not work with multiple selection.
7476

77+
Keyboard interactions for multiple selection are described in the [Keyboard Interactions](#multiple-selection-1) section below.
78+
7579
import MultipleSelectionExample from '@site/static/usage/v7/select/basic/multiple-selection/index.md';
7680

7781
<MultipleSelectionExample />
@@ -82,25 +86,19 @@ By default, select uses [ion-alert](alert.md) to open up the overlay of options
8286

8387
### Alert
8488

85-
Keyboard interactions for the `alert` interface are described in the [Keyboard Interactions](#interface-alert) section below.
86-
8789
import AlertExample from '@site/static/usage/v7/select/basic/single-selection/index.md';
8890

8991
<AlertExample />
9092

9193

9294
### Action Sheet
9395

94-
Keyboard interactions for the `action-sheet` interface are described in the [Keyboard Interactions](#interface-action-sheet) section below.
95-
9696
import ActionSheetExample from '@site/static/usage/v7/select/interfaces/action-sheet/index.md';
9797

9898
<ActionSheetExample />
9999

100100
### Popover
101101

102-
Keyboard interactions for the `popover` interface are described in the [Keyboard Interactions](#interface-popover) section below.
103-
104102
import PopoverExample from '@site/static/usage/v7/select/interfaces/popover/index.md';
105103

106104
<PopoverExample />
@@ -268,58 +266,51 @@ Ionic uses heuristics to detect if an app is using the modern select syntax. In
268266

269267
### Keyboard Interactions
270268

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.
272270

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:
274272
- The select is closed.
275273
- The select is focused.
276274
- The select is not disabled.
277275

278276
|Key|Description|
279277
|----|----|
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.|
281278
|<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.|
282280

283-
#### Interface: Alert
284281

285-
These keyboard interactions apply to the `ion-alert` dialog when the overlay is presented and focused.
282+
#### Single Selection
286283

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/).
297285

298-
#### Interface: Action Sheet
299286

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.
301288

302289
|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.|
304296
|<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.|
308299

309-
#### Interface: Popover
310300

311-
These keyboard interactions apply to the [`ion-popover` dialog](#popover) when the overlay is presented and focused.
312301

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.
322307

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.|
323314

324315
## Properties
325316
<Props />

0 commit comments

Comments
 (0)