@@ -37,7 +37,6 @@ interface Props {
37
37
| number
38
38
| React .MutableRefObject < HTMLElement | null > ;
39
39
returnFocus?: boolean;
40
- preventTabbing?: boolean;
41
40
endGuard?: boolean;
42
41
modal?: boolean;
43
42
}
@@ -85,9 +84,6 @@ Which element to initially focus. Can be either a number
85
84
(tabbable index as specified by the ` order{:.objectKey} ` ) or a
86
85
ref.
87
86
88
- > This does not have an effect when ` preventTabbing{:.keyword} `
89
- > is enabled.
90
-
91
87
``` js
92
88
< FloatingFocusManager
93
89
context= {context}
@@ -105,35 +101,12 @@ Determines if focus should be returned to the element that was
105
101
focused prior to opening the floating element (usually the
106
102
reference element).
107
103
108
- > This does not have an effect when ` preventTabbing{:.keyword} `
109
- > is enabled.
110
-
111
104
``` js
112
105
< FloatingFocusManager context= {context} returnFocus= {false }>
113
106
{/* floating element */ }
114
107
< / FloatingFocusManager>
115
108
```
116
109
117
- ### preventTabbing
118
-
119
- default: ` false{:js} `
120
-
121
- Determines if the tab key does not perform any action, so that
122
- focus cannot escape the floating element. Focus is instead
123
- handled by ` useListNavigation(){:js} ` (i.e. arrow key
124
- navigation).
125
-
126
- This prop is required when the focus is
127
- [ modal] ( /docs/FloatingFocusManager#modal ) and the floating
128
- element is portalled outside of the reference element's DOM
129
- context.
130
-
131
- ``` js
132
- < FloatingFocusManager context= {context} preventTabbing= {true }>
133
- {/* floating element */ }
134
- < / FloatingFocusManager>
135
- ```
136
-
137
110
### endGuard
138
111
139
112
default: ` true{:js} `
@@ -157,20 +130,44 @@ Determines if focus is "modal", meaning focus is fully trapped
157
130
inside the floating element and outside content cannot be
158
131
accessed. This includes screen reader virtual cursors.
159
132
160
- > If ` false{:js} ` , the floating element must be rendered directly
161
- > after its reference element (e.g. not in a FloatingPortal).
162
-
163
133
``` js
164
134
< FloatingFocusManager context= {context} modal= {false }>
165
135
{/* floating element */ }
166
136
< / FloatingFocusManager>
167
137
```
168
138
169
- #### Input comboboxes
139
+ #### Non-modal behavior
140
+
141
+ The floating element must be rendered directly after its
142
+ reference element (e.g. not in a FloatingPortal) when non-modal.
143
+
144
+ #### Modal behavior
145
+
146
+ Ensure you have an explicit "close" button. This can be either
147
+ visible to all users, or visually-hidden so it is only available
148
+ to assistive tech.
149
+
150
+ Touch-based screen readers often will not have an ` esc ` key
151
+ available to dismiss the element, so an explicit close button is
152
+ required.
153
+
154
+ You may use the reference element as the close button with some
155
+ components, so the user can navigate to it and use it as a toggle
156
+ to both close and open the floating element. This can be achieved
157
+ with the ` order{:.keyword} ` prop and adding the reference as a
158
+ string.
159
+
160
+ #### Comboboxes
161
+
162
+ The listbox part of a combobox should be rendered directly after
163
+ the input reference element when possible.
164
+
165
+ If the listbox is portaled, detection is added so that DOM focus
166
+ does not become modal in this case, but screen reader virtual
167
+ cursors do become modal. This ensures a touch user can swipe
168
+ right (e.g. iOS screen reader) to navigate the listbox options
169
+ immediately.
170
170
171
- ` <input />{:js} ` comboboxes should not be modal when possible.
172
- When setting them to modal, focus does not become modal but
173
- screen reader virtual cursors do become modal. Therefore, the
174
- listbox should have a visually-hidden dismiss button to ensure
175
- touch-based screen reader users can escape the list without
176
- needing to select anything.
171
+ As with all modal-based focus management, the listbox should have
172
+ a visually-hidden dismiss button to ensure touch-based screen
173
+ reader users can escape the list due to a lack of an ` esc ` key.
0 commit comments