-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
fix(DataGrid): Single select should not render header selection indicator #33752
base: master
Are you sure you want to change the base?
fix(DataGrid): Single select should not render header selection indicator #33752
Conversation
@@ -25,6 +25,7 @@ export const useDataGridRow_unstable = (props: DataGridRowProps, ref: React.Ref< | |||
const selected = useDataGridContext_unstable(ctx => ctx.selection.isRowSelected(rowId)); |
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.
🕵🏾♀️ visual regressions to review in the fluentuiv9 Visual Regression Report
Avatar Converged 2 screenshots
Image Name | Diff(in Pixels) | Image Type |
---|---|---|
Avatar Converged.Badge Mask RTL.chromium.png | 8 | Changed |
Avatar Converged.badgeMask.chromium.png | 3 | Changed |
DataGridConverged - subtle multi select 1 screenshots
Image Name | Diff(in Pixels) | Image Type |
---|---|---|
DataGridConverged - subtle multi select.default.chromium.png | 0 | Added |
DataGridConverged - subtle single select 1 screenshots
Image Name | Diff(in Pixels) | Image Type |
---|---|---|
DataGridConverged - subtle single select.default.chromium.png | 0 | Added |
919493c
to
97a00c7
Compare
📊 Bundle size reportUnchanged fixtures
|
Pull request demo site: URL |
This reverts commit 40ab46b.
@@ -183,6 +183,20 @@ describe('DataGridRow', () => { | |||
expect(toggleRow).toHaveBeenCalledTimes(0); | |||
}); | |||
|
|||
it('should disable selection cell input if the row is in a header and the selection mode is singe', () => { |
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.
it('should disable selection cell input if the row is in a header and the selection mode is singe', () => { | |
it('should disable selection cell input if the row is in a header and the selection mode is single', () => { |
🐱
const isHeader = useIsInTableHeader(); | ||
const isSingleSelect = useDataGridContext_unstable(ctx => ctx.selection.selectionMode === 'single'); | ||
const isSubtle = useDataGridContext_unstable(ctx => ctx.subtleSelection); |
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.
IMO this should be moved to state as in other components
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.
If this is moved to state, the only purpose would be to increase our API surface, and pass through to this hook where it is used.
Since styles hooks are hooks, what's the consequence?
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.
As discussed these changes are for DataGrid - updated the PR title to reflect this |
Creates specific overrides for subtle selection in the DataGridRow styles and makes the radio input in the header disabled so that users cannot navigate to it with keyboard or screen reader
Fixes #33667
Fixes #33561