Skip to content

Commit

Permalink
[core] TrapFocus was renamed to FocusTrap
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Sep 10, 2023
1 parent ffd1fdd commit e00af64
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
@@ -1,7 +1,7 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import TrapFocus, { TrapFocusProps } from '@mui/material/Unstable_TrapFocus';
import FocusTrap, { TrapFocusProps } from '@mui/material/Unstable_TrapFocus';
import { styled, Theme } from '@mui/material/styles';
import { MUIStyledCommonProps } from '@mui/system';
import { unstable_composeClasses as composeClasses } from '@mui/utils';
Expand Down Expand Up @@ -51,15 +51,15 @@ const GridPanelWrapper = React.forwardRef<HTMLDivElement, GridPanelWrapperProps>
const classes = useUtilityClasses(rootProps);

return (
<TrapFocus open disableEnforceFocus isEnabled={isEnabled} {...slotProps.TrapFocus}>
<FocusTrap open disableEnforceFocus isEnabled={isEnabled} {...slotProps.TrapFocus}>
<GridPanelWrapperRoot
ref={ref}
tabIndex={-1}
className={clsx(className, classes.root)}
ownerState={rootProps}
{...other}
/>
</TrapFocus>
</FocusTrap>
);
},
);
Expand Down
Expand Up @@ -7,7 +7,7 @@ import MuiPopper, {
PopperProps as MuiPopperProps,
PopperPlacementType,
} from '@mui/material/Popper';
import MuiTrapFocus, {
import BaseFocusTrap, {
TrapFocusProps as MuiTrapFocusProps,
} from '@mui/material/Unstable_TrapFocus';
import {
Expand Down Expand Up @@ -61,7 +61,7 @@ export interface PickersPopperSlotsComponentsProps {
*/
desktopTransition?: Partial<MuiTransitionProps>;
/**
* Props passed down to the [TrapFocus](https://mui.com/base/react-focus-trap/) component on desktop.
* Props passed down to the [FocusTrap](https://mui.com/base/react-focus-trap/) component on desktop.
*/
desktopTrapFocus?: Partial<MuiTrapFocusProps>;
/**
Expand Down Expand Up @@ -396,7 +396,7 @@ export function PickersPopper(inProps: PickerPopperProps) {
};

const Transition = slots?.desktopTransition ?? reduceAnimations ? Fade : Grow;
const TrapFocus = slots?.desktopTrapFocus ?? MuiTrapFocus;
const FocusTrap = slots?.desktopTrapFocus ?? BaseFocusTrap;

const Paper = slots?.desktopPaper ?? PickersPopperPaper;
const Popper = slots?.popper ?? PickersPopperRoot;
Expand All @@ -418,7 +418,7 @@ export function PickersPopper(inProps: PickerPopperProps) {
return (
<Popper {...popperProps}>
{({ TransitionProps, placement: popperPlacement }) => (
<TrapFocus
<FocusTrap
open={open}
disableAutoFocus
// pickers are managing focus position manually
Expand All @@ -443,7 +443,7 @@ export function PickersPopper(inProps: PickerPopperProps) {
{children}
</PickersPopperPaperWrapper>
</Transition>
</TrapFocus>
</FocusTrap>
)}
</Popper>
);
Expand Down

0 comments on commit e00af64

Please sign in to comment.