Skip to content
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] fix: popper focus trap #16736

Merged
merged 3 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/x-data-grid/src/components/panel/GridPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ const GridPanel = forwardRef<HTMLElement, GridPanelProps>((props, ref) => {
clickAwayMouseEvent="onPointerUp"
clickAwayTouchEvent={false}
focusTrap
focusTrapEnabled
{...other}
{...rootProps.slotProps?.basePopper}
ref={ref}
Expand Down
4 changes: 2 additions & 2 deletions packages/x-data-grid/src/material/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,8 @@ function focusTrapWrapper(props: PopperProps, content: any) {
return content;
}
return (
<MUIFocusTrap open disableEnforceFocus isEnabled={() => props.focusTrapEnabled ?? true}>
{content}
<MUIFocusTrap open disableEnforceFocus>
<div tabIndex={-1}>{content}</div>
</MUIFocusTrap>
);
}
Expand Down
1 change: 0 additions & 1 deletion packages/x-data-grid/src/models/gridBaseSlots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ export type PopperProps = {
clickAwayMouseEvent?: false | ClickAwayMouseEventHandler;
flip?: boolean;
focusTrap?: boolean;
focusTrapEnabled?: boolean;
onExited?: (node: HTMLElement | null) => void;
onClickAway?: (event: MouseEvent | TouchEvent) => void;
onDidShow?: () => void;
Expand Down