Skip to content

Commit dd157f1

Browse files
mj12albertbrijeshb42Brijesh Bittusai6855
authored
[release] v7.1.2 (#46371)
Co-authored-by: Brijesh Bittu <[email protected]> Co-authored-by: Brijesh Bittu <[email protected]> Co-authored-by: sai chand <[email protected]>
1 parent 0ebb3a1 commit dd157f1

File tree

10 files changed

+64
-10
lines changed

10 files changed

+64
-10
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# [Versions](https://mui.com/versions/)
22

3+
## 7.1.2
4+
5+
_Jun 18, 2025_
6+
7+
A big thanks to the 2 contributors who made this release possible.
8+
9+
10+
11+
- [Chip] Fix handling on event handlers (#46263) @sai6855
12+
13+
### Docs
14+
15+
- Fix fade modal demo (#46271) @brijeshb42
16+
17+
All contributors of this release in alphabetical order: @brijeshb42, @sai6855
18+
319
## 7.1.1
420

521
<!-- generated comparing v7.1.0..master -->

docs/data/joy/components/modal/FadeModalDialog.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ import DialogContent from '@mui/joy/DialogContent';
88

99
export default function FadeModalDialog() {
1010
const [open, setOpen] = React.useState(false);
11+
const nodeRef = React.useRef(null);
12+
1113
return (
1214
<React.Fragment>
1315
<Button variant="outlined" color="neutral" onClick={() => setOpen(true)}>
1416
Open modal
1517
</Button>
16-
<Transition in={open} timeout={400}>
18+
<Transition nodeRef={nodeRef} in={open} timeout={400}>
1719
{(state) => (
1820
<Modal
21+
ref={nodeRef}
1922
keepMounted
2023
open={!['exited', 'exiting'].includes(state)}
2124
onClose={() => setOpen(false)}

docs/data/joy/components/modal/FadeModalDialog.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ import DialogContent from '@mui/joy/DialogContent';
88

99
export default function FadeModalDialog() {
1010
const [open, setOpen] = React.useState<boolean>(false);
11+
const nodeRef = React.useRef(null);
12+
1113
return (
1214
<React.Fragment>
1315
<Button variant="outlined" color="neutral" onClick={() => setOpen(true)}>
1416
Open modal
1517
</Button>
16-
<Transition in={open} timeout={400}>
18+
<Transition nodeRef={nodeRef} in={open} timeout={400}>
1719
{(state: string) => (
1820
<Modal
21+
ref={nodeRef}
1922
keepMounted
2023
open={!['exited', 'exiting'].includes(state)}
2124
onClose={() => setOpen(false)}

packages/mui-core-downloads-tracker/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mui/core-downloads-tracker",
3-
"version": "7.1.1",
3+
"version": "7.1.2",
44
"author": "MUI Team",
55
"description": "Internal package to track number of downloads of our design system libraries.",
66
"files": [],

packages/mui-docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mui/docs",
3-
"version": "7.1.1",
3+
"version": "7.1.2",
44
"author": "MUI Team",
55
"description": "MUI Docs - Documentation building blocks.",
66
"main": "./src/index.js",

packages/mui-icons-material/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mui/icons-material",
3-
"version": "7.1.1",
3+
"version": "7.1.2",
44
"author": "MUI Team",
55
"description": "Material Design icons distributed as SVG React components.",
66
"main": "./src/index.js",

packages/mui-lab/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@mui/lab",
33
"//": "version should be 'alpha' at all time",
4-
"version": "7.0.0-beta.13",
4+
"version": "7.0.0-beta.14",
55
"author": "MUI Team",
66
"description": "Laboratory for new Material UI modules.",
77
"main": "./src/index.js",

packages/mui-material/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mui/material",
3-
"version": "7.1.1",
3+
"version": "7.1.2",
44
"author": "MUI Team",
55
"description": "Material UI is an open-source React component library that implements Google's Material Design. It's comprehensive and can be used in production out of the box.",
66
"main": "./src/index.ts",

packages/mui-material/src/Chip/Chip.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,15 +531,15 @@ const Chip = React.forwardRef(function Chip(inProps, ref) {
531531
...handlers,
532532
onClick: (event) => {
533533
handlers.onClick?.(event);
534-
onClick(event);
534+
onClick?.(event);
535535
},
536536
onKeyDown: (event) => {
537537
handlers.onKeyDown?.(event);
538-
handleKeyDown(event);
538+
handleKeyDown?.(event);
539539
},
540540
onKeyUp: (event) => {
541541
handlers.onKeyUp?.(event);
542-
handleKeyUp(event);
542+
handleKeyUp?.(event);
543543
},
544544
}),
545545
});

packages/mui-material/src/Chip/Chip.test.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,4 +733,36 @@ describe('<Chip />', () => {
733733
).not.to.throw();
734734
});
735735
});
736+
737+
it('should not throw on clicking Chip when onClick is not provided', () => {
738+
expect(() => {
739+
const { getByTestId } = render(<Chip data-testid="chip" />);
740+
const chip = getByTestId('chip');
741+
fireEvent.click(chip);
742+
}).not.throw();
743+
});
744+
745+
it('should not throw on keydown when onKeyDown is not provided', () => {
746+
expect(() => {
747+
const { getByTestId } = render(<Chip data-testid="chip" onClick={() => {}} />);
748+
const chip = getByTestId('chip');
749+
act(() => {
750+
chip.focus();
751+
});
752+
753+
fireEvent.keyDown(chip, { key: 'Enter' });
754+
}).not.throw();
755+
});
756+
757+
it('should not throw on keyup when onKeyUp is not provided', () => {
758+
expect(() => {
759+
const { getByTestId } = render(<Chip data-testid="chip" onClick={() => {}} />);
760+
const chip = getByTestId('chip');
761+
act(() => {
762+
chip.focus();
763+
});
764+
765+
fireEvent.keyUp(chip, { key: ' ' });
766+
}).not.throw();
767+
});
736768
});

0 commit comments

Comments
 (0)