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/data/material/components/selects/selects.md
-61Lines changed: 0 additions & 61 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -141,67 +141,6 @@ Display categories with the `ListSubheader` component or the native `<optgroup>`
141
141
142
142
{{"demo": "GroupedSelect.js"}}
143
143
144
-
:::warning
145
-
If you wish to wrap the ListSubheader in a custom component, you'll have to annotate it so Material UI can handle it properly when determining focusable elements.
146
-
147
-
You have two options for solving this:
148
-
Option 1: Define a static boolean field called `muiSkipListHighlight` on your component function, and set it to `true`:
149
-
150
-
```tsx
151
-
function MyListSubheader(props:ListSubheaderProps) {
152
-
return <ListSubheader{...props} />;
153
-
}
154
-
155
-
MyListSubheader.muiSkipListHighlight=true;
156
-
exportdefaultMyListSubheader;
157
-
158
-
// elsewhere:
159
-
160
-
return (
161
-
<Select>
162
-
<MyListSubheader>Group 1</MyListSubheader>
163
-
<MenuItemvalue={1}>Option 1</MenuItem>
164
-
<MenuItemvalue={2}>Option 2</MenuItem>
165
-
<MyListSubheader>Group 2</MyListSubheader>
166
-
<MenuItemvalue={3}>Option 3</MenuItem>
167
-
<MenuItemvalue={4}>Option 4</MenuItem>
168
-
{/* ... */}
169
-
</Select>
170
-
```
171
-
172
-
Option 2: Place a `muiSkipListHighlight` prop on each instance of your component.
173
-
The prop doesn't have to be forwarded to the ListSubheader, nor present in the underlying DOM element.
174
-
It just has to be placed on a component that's used as a subheader.
Copy file name to clipboardExpand all lines: docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md
+13-5Lines changed: 13 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -286,20 +286,28 @@ The `StepButton` has:
286
286
287
287
### Tabs
288
288
289
-
The `tabindex` attribute for each tab will be changed on Arrow Key or Home / End navigation. Previously, we only moved the focus on keyboard navigation. Now, we move the focus and also add the `tabindex="0"` to the focused element. The previously focused element will have its `tabindex` updated to `-1` in order to keep only one focusable `Tab` at a time.
289
+
The `tabindex` attribute for each tab will be changed on Arrow Key or Home / End navigation. Previously, keyboard navigation moved DOM focus without updating `tabindex`on the focused `Tab`. Now, we move DOM focus and also add the `tabindex="0"` to the focused `Tab`. Other tabs will have `tabindex="-1"` to keep only one focusable `Tab` at a time.
290
290
291
291
Selecting a `Tab` will update the focus and `tabindex` as before.
292
292
293
-
### Menu and MenuList
293
+
`Tab`s not placed inside `Tabs` will now throw an error.
294
294
295
-
The `tabindex` attribute for each menu item will be changed on Arrow Key, Home / End or Character Key navigation. Previously, we only moved the focus on keyboard navigation. Now, we move the focus and also add the `tabindex="0"` to the focused element. The previously focused element will have its `tabindex` updated to `-1` in order to keep only one focusable `MenuItem` at a time.
295
+
### Menu and MenuList
296
296
297
-
This change also applies to the `Menu` since it uses `MenuList`.
297
+
When using `variant="selectedMenu"`, the `tabindex` attribute for each menu item will change on Arrow Key, Home / End or Character Key navigation. Previously, keyboard navigation moved DOM focus without updating `tabindex` on focused items. Now, we move DOM focus and also add `tabindex="0"`to the focused element. The previously focused element will have its `tabindex` updated to `-1` in order to keep only one focusable `MenuItem` at a time.
298
298
299
-
Selecting a `MenuItem` will update the focus and `tabindex` as before.
299
+
This change also applies both `Menu`and `MenuList` with `variant="selectedMenu"`.
300
300
301
301
The `autoFocus` prop in `MenuList` does not set `tabindex="0"` on the `List` component anymore. It will always stay as `-1`.
302
302
303
+
`MenuItem`s will throw an error when rendered outside of `Menu` or `MenuList`.
304
+
305
+
Keyboard navigation now supports `MenuItem`s inside `React.Fragment`.
306
+
307
+
Custom non-interactive menu content such as `ListSubheader` or `Divider` no longer need to set `muiSkipListHighlight` to opt-out of the menu's focus management.
308
+
309
+
Custom children that set `role="menuitem"` but do not wrap the `MenuItem` component are no longer supported inside `Menu` or `MenuList`.
310
+
303
311
## Deprecated APIs removed (Breaking)
304
312
305
313
APIs that were deprecated earlier have been removed in v9.
0 commit comments