-
Notifications
You must be signed in to change notification settings - Fork 2.9k
fix: GroupedList sets correct focus attributes on List #30484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "patch", | ||
| "comment": "fix: GroupedList sets correct focus attributes on List", | ||
| "packageName": "@fluentui/react", | ||
| "email": "[email protected]", | ||
| "dependentChangeType": "patch" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,12 @@ | ||
| import * as React from 'react'; | ||
| import { initializeComponentRef, classNamesFunction, KeyCodes, getRTLSafeKeyCode, css } from '../../Utilities'; | ||
| import { | ||
| initializeComponentRef, | ||
| classNamesFunction, | ||
| FocusRects, | ||
| KeyCodes, | ||
| getRTLSafeKeyCode, | ||
| css, | ||
| } from '../../Utilities'; | ||
| import { GroupedListSection } from './GroupedListSection'; | ||
| import { List, ScrollToMode } from '../../List'; | ||
| import { SelectionMode } from '../../Selection'; | ||
|
|
@@ -154,6 +161,7 @@ export class GroupedListBase extends React.Component<IGroupedListProps, IGrouped | |
| shouldEnterInnerZone={shouldEnterInnerZone} | ||
| className={css(this._classNames.root, focusZoneProps.className)} | ||
| > | ||
| <FocusRects /> | ||
| {!groups ? ( | ||
| this._renderGroup(undefined, 0) | ||
| ) : ( | ||
|
|
@@ -168,6 +176,7 @@ export class GroupedListBase extends React.Component<IGroupedListProps, IGrouped | |
| usePageCache={usePageCache} | ||
| onShouldVirtualize={onShouldVirtualize} | ||
| version={version} | ||
| renderEarly={true} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm a bit concerned about changing this default behavior as doing so broke
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose it's impossible to really be sure, since GroupedList seems to get some pretty custom usage. The only other potential approach I can think of would be to manually apply Thoughts on which is better?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe the answer here to allow people to opt out of early rendering?
(perhaps there is a less verbose way of writing that). The early rendering is a better option as it addresses the underlying issue of the DOM just not being present but it is also much more likely to break something using Allowing folks to opt out will at least give people an easy change should they need it. That said, there is an argument that this is a breaking change and we should rather require users to opt in. Not a serious suggestion: ... actually that last suggestion got me thinking: is this an issue with |
||
| {...rootListProps} | ||
| /> | ||
| )} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to make the same change for
GroupedListV2?