Skip to content

Commit fd5863a

Browse files
Disable StrictMode in focus trap
1 parent 3360bc8 commit fd5863a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/mui-base/src/FocusTrap/FocusTrap.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import * as ReactDOM from 'react-dom';
33
import { expect } from 'chai';
4-
import { act, createRenderer, screen } from '@mui/internal-test-utils';
4+
import { act, createRenderer, reactMajor, screen } from '@mui/internal-test-utils';
55
import { FocusTrap } from '@mui/base/FocusTrap';
66
import { Portal } from '@mui/base/Portal';
77

@@ -219,7 +219,7 @@ describe('<FocusTrap />', () => {
219219
</div>
220220
);
221221
}
222-
const { setProps, getByRole } = render(<Test />);
222+
const { setProps, getByRole } = render(<Test />, { strict: reactMajor <= 18 });
223223
expect(screen.getByTestId('root')).toHaveFocus();
224224

225225
act(() => {

packages/mui-material/src/Unstable_TrapFocus/FocusTrap.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import * as ReactDOM from 'react-dom';
33
import { expect } from 'chai';
4-
import { act, createRenderer, screen } from '@mui/internal-test-utils';
4+
import { act, createRenderer, reactMajor, screen } from '@mui/internal-test-utils';
55
import FocusTrap from '@mui/material/Unstable_TrapFocus';
66
import Portal from '@mui/material/Portal';
77

@@ -219,7 +219,7 @@ describe('<FocusTrap />', () => {
219219
</div>
220220
);
221221
}
222-
const { setProps, getByRole } = render(<Test />);
222+
const { setProps, getByRole } = render(<Test />, { strict: reactMajor <= 18 });
223223
expect(screen.getByTestId('root')).toHaveFocus();
224224

225225
act(() => {

0 commit comments

Comments
 (0)