Skip to content

Commit

Permalink
[DataGrid] Fix toggling preference panel from toolbar (@lauri865) (#1…
Browse files Browse the repository at this point in the history
…6276)

Co-authored-by: Lauri <[email protected]>
  • Loading branch information
github-actions[bot] and lauri865 authored Jan 21, 2025
1 parent 093cf6a commit 95dc368
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/x-data-grid/src/components/panel/GridPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const GridPanel = forwardRef<HTMLDivElement, GridPanelProps>((props, ref) => {
{...other}
ref={ref}
>
<ClickAwayListener mouseEvent="onMouseUp" onClickAway={handleClickAway}>
<ClickAwayListener mouseEvent="onPointerUp" touchEvent={false} onClickAway={handleClickAway}>
<GridPaperRoot
className={classes.paper}
ownerState={rootProps}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ const GridToolbarColumnsButton = forwardRef<HTMLButtonElement, GridToolbarColumn
aria-controls={isOpen ? columnPanelId : undefined}
startIcon={<rootProps.slots.columnSelectorIcon />}
onClick={showColumns}
onPointerUp={(event) => {
if (preferencePanel.open) {
event.stopPropagation();
}
}}
{...rootProps.slotProps?.baseButton}
{...buttonProps}
ref={ref}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ const GridToolbarFilterButton = forwardRef<HTMLButtonElement, GridToolbarFilterB
</rootProps.slots.baseBadge>
}
onClick={toggleFilter}
onPointerUp={(event) => {
if (preferencePanel.open) {
event.stopPropagation();
}
}}
{...rootProps.slotProps?.baseButton}
{...buttonProps}
ref={ref}
Expand Down

0 comments on commit 95dc368

Please sign in to comment.