-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[DataGrid] Remove unnecessary keyboard navigation events #6863
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 | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -10,7 +10,6 @@ import { | |||||||||
GridRenderCellParams, | ||||||||||
GridGroupNode, | ||||||||||
} from '@mui/x-data-grid'; | ||||||||||
import { isNavigationKey } from '@mui/x-data-grid/internals'; | ||||||||||
import { useGridRootProps } from '../hooks/utils/useGridRootProps'; | ||||||||||
import { useGridApiContext } from '../hooks/utils/useGridApiContext'; | ||||||||||
import { DataGridProProcessedProps } from '../models/dataGridProProps'; | ||||||||||
|
@@ -55,15 +54,6 @@ function GridTreeDataGroupingCell(props: GridTreeDataGroupingCellProps) { | |||||||||
? rootProps.components.TreeDataCollapseIcon | ||||||||||
: rootProps.components.TreeDataExpandIcon; | ||||||||||
|
||||||||||
const handleKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>) => { | ||||||||||
if (event.key === ' ') { | ||||||||||
event.stopPropagation(); | ||||||||||
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. This mui-x/packages/grid/x-data-grid/src/hooks/features/keyboardNavigation/useGridKeyboardNavigation.ts Lines 178 to 181 in 4d77507
This also explains its removal from the demos. |
||||||||||
} | ||||||||||
if (isNavigationKey(event.key) && !event.shiftKey) { | ||||||||||
apiRef.current.publishEvent('cellNavigationKeyDown', props, event); | ||||||||||
} | ||||||||||
}; | ||||||||||
|
||||||||||
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => { | ||||||||||
apiRef.current.setRowChildrenExpansion(id, !rowNode.childrenExpanded); | ||||||||||
apiRef.current.setCellFocus(id, field); | ||||||||||
|
@@ -77,7 +67,6 @@ function GridTreeDataGroupingCell(props: GridTreeDataGroupingCellProps) { | |||||||||
<IconButton | ||||||||||
size="small" | ||||||||||
onClick={handleClick} | ||||||||||
onKeyDown={handleKeyDown} | ||||||||||
tabIndex={-1} | ||||||||||
aria-label={ | ||||||||||
rowNode.childrenExpanded | ||||||||||
|
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.
I'm referring to
mui-x/packages/grid/x-data-grid/src/hooks/features/keyboardNavigation/useGridKeyboardNavigation.ts
Lines 173 to 181 in 4d77507
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.
Maybe create a separate issue for it and link to it in the TODO comment?