Skip to content

Commit 41b30d6

Browse files
Modal docs - Add callout banners explaining visual focus (HDS-5423) (#3130)
1 parent ec2e27e commit 41b30d6

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

website/docs/components/modal/partials/accessibility/accessibility.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ The Modal component is conformant when used as directed.
66

77
## Focus and focus order
88

9+
!!! info
10+
11+
Browsers use a variety of heuristics to decide when to visually show focus state based on what is considered most useful to users. For that reason, even though the Modal’s dismiss button is focused by default, it may not visually appear to be focused.
12+
13+
!!!
14+
915
- When the modal is open, focus moves to the first interactive element within the modal and is trapped within the component.
1016
- Since a Modal is a complex pattern that can contain any combination of nested components and content, nested elements must adhere to their individual accessibility criteria.
1117

website/docs/components/modal/partials/code/how-to-use.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ As an overlaying component, the `Hds::Modal` is rendered on the [top layer](http
1212

1313
## Focus and focus trap
1414

15+
!!! info
16+
17+
Browsers use a variety of heuristics to decide when to visually show focus state based on what is considered most useful to users. For that reason, even though the Modal’s dismiss button is focused by default, it may not visually appear to be focused.
18+
19+
!!!
20+
1521
This component uses [`ember-focus-trap`](https://github.com/josemarluedke/ember-focus-trap) to prevent the focus from going outside the Modal and to dismiss the Modal when clicking outside the Modal. This Ember modifier requires at least one interactive element to be present within the Modal, which is by default achieved by the dismiss button in the header.
1622

1723
When a Modal is opened with the keyboard, the focus is automatically set to the first focusable element inside the Modal, which is the “Dismiss” button. The action of this button has no effect on the system, so focusing on it helps prevent users from accidentally confirming the Modal.

0 commit comments

Comments
 (0)