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
Example was using out-of-date PatternFly syntax from a prior version. It should now show how to properly add a dropdown to a modal that allows for keyboard accessibility.
Copy file name to clipboardExpand all lines: packages/react-core/src/components/Modal/examples/Modal.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ import formStyles from '@patternfly/react-styles/css/components/Form/form';
17
17
18
18
### Basic modals
19
19
20
-
Basic modals give users the option to either confirm or cancel an action.
20
+
Basic modals give users the option to either confirm or cancel an action.
21
21
22
22
To flag an open modal, use the `isOpen` property. To execute a callback when a modal is closed, use the `onClose` property.
23
23
@@ -71,7 +71,7 @@ To choose a specific width for a modal, use the `width` property. The following
71
71
72
72
### Custom header
73
73
74
-
To add a custom header to a modal, your custom content must be passed as a child of the `<ModalHeader>` component. Do not pass the `title` property to `<ModalHeader>` when using a custom header.
74
+
To add a custom header to a modal, your custom content must be passed as a child of the `<ModalHeader>` component. Do not pass the `title` property to `<ModalHeader>` when using a custom header.
75
75
76
76
```ts file="./ModalCustomHeader.tsx"
77
77
@@ -113,9 +113,9 @@ To guide users through a series of steps in a modal, you can add a [wizard](/com
113
113
114
114
### With dropdown
115
115
116
-
To present a menu of actions or links to a user, you can add a [dropdown](/components/menus/dropdown) to a modal.
116
+
To present a menu of actions or links to a user, you can add a [dropdown](/components/menus/dropdown) to a modal.
117
117
118
-
To allow the dropdown to visually break out of the modal container, set the `menuAppendTo` property to “parent”. Handle the modal’s closing behavior by listening to the `onEscapePress` callback on the `<Modal>` component. This allows the "escape" key to collapse the dropdown without closing the entire modal.
118
+
To allow the dropdown to visually break out of the modal container, set the `popperProps appendTo` property to one of the parent content items in the modal. Otherwise you can use `inline` to allow it to scroll within the modal itself. Using the Dropdown's default append location will interfere with keyboard accessibility due to the modal's built-in focus trap. Handle the modal’s closing behavior by listening to the `onEscapePress` callback on the `<Modal>` component. This allows the "escape" key to collapse the dropdown without closing the entire modal.
119
119
120
120
```ts file="./ModalWithDropdown.tsx"
121
121
@@ -141,7 +141,7 @@ To enable form submission from a button in the modal's footer (outside of the `<
141
141
142
142
### Custom focus
143
143
144
-
To customize which element inside the modal receives focus when initially opened, use the `elementToFocus` property`.
144
+
To customize which element inside the modal receives focus when initially opened, use the `elementToFocus` property`.
0 commit comments