Skip to content

Commit edeb81a

Browse files
authored
Merge branch 'master' into renovate/jsdom-27.x
2 parents 3cbcb8d + 57bd892 commit edeb81a

File tree

9 files changed

+64
-6
lines changed

9 files changed

+64
-6
lines changed

docs/next.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ export default withDocsInfra({
9292

9393
// for 3rd party packages with dependencies in this repository
9494
'@mui/material$': path.resolve(workspaceRoot, 'packages/mui-material/src/index.js'),
95+
'@mui/material/package.json': path.resolve(
96+
workspaceRoot,
97+
'packages/mui-material/package.json',
98+
),
9599
'@mui/material': path.resolve(workspaceRoot, 'packages/mui-material/src'),
96100

97101
'@mui/docs': path.resolve(workspaceRoot, 'packages/mui-docs/src'),
@@ -102,10 +106,15 @@ export default withDocsInfra({
102106
'@mui/icons-material': path.resolve(workspaceRoot, 'packages/mui-icons-material/lib/esm'),
103107
'@mui/lab': path.resolve(workspaceRoot, 'packages/mui-lab/src'),
104108
'@mui/styled-engine': path.resolve(workspaceRoot, 'packages/mui-styled-engine/src'),
109+
'@mui/system/package.json': path.resolve(
110+
workspaceRoot,
111+
'packages/mui-system/package.json',
112+
),
105113
'@mui/system': path.resolve(workspaceRoot, 'packages/mui-system/src'),
106114
'@mui/private-theming': path.resolve(workspaceRoot, 'packages/mui-private-theming/src'),
107115
'@mui/utils': path.resolve(workspaceRoot, 'packages/mui-utils/src'),
108116
'@mui/material-nextjs': path.resolve(workspaceRoot, 'packages/mui-material-nextjs/src'),
117+
'@mui/joy/package.json': path.resolve(workspaceRoot, 'packages/mui-joy/package.json'),
109118
'@mui/joy': path.resolve(workspaceRoot, 'packages/mui-joy/src'),
110119
},
111120
extensions: [

netlify.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
NODE_VERSION = "22.18"
1010
PNPM_FLAGS = "--frozen-lockfile"
1111

12-
[[plugins]]
13-
package = "@mui/internal-netlify-cache"
12+
# [[plugins]]
13+
# package = "@mui/internal-netlify-cache"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"release:changelog": "node scripts/releaseChangelog.mjs",
1818
"release:pack": "tsx scripts/releasePack.mts",
1919
"docs:api": "rimraf --glob ./docs/pages/**/api-docs ./docs/pages/**/api && pnpm docs:api:build",
20-
"docs:api:build": "tsx ./scripts/buidApiDocs/index.ts",
20+
"docs:api:build": "tsx ./scripts/buildApiDocs/index.ts",
2121
"docs:llms:build": "rimraf --glob ./docs/public/material-ui/ && tsx ./scripts/buildLlmsDocs/index.ts --projectSettings ./packages/api-docs-builder-core/materialUi/projectSettings.ts",
2222
"docs:build": "pnpm docs:llms:build && pnpm --filter docs build",
2323
"docs:build-sw": "pnpm --filter docs build-sw",

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

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3683,6 +3683,49 @@ describe('<Autocomplete />', () => {
36833683

36843684
expect(view.container.querySelector(`.${chipClasses.root}`)).to.have.text('0');
36853685
});
3686+
3687+
it('should not throw error on pressing ArrowLeft key with no value in single value rendering', () => {
3688+
render(
3689+
<Autocomplete
3690+
options={['one', 'two', 'three']}
3691+
renderValue={(value, getItemProps) => {
3692+
return value ? <Chip label={value} {...getItemProps()} /> : null;
3693+
}}
3694+
renderInput={(params) => <TextField {...params} autoFocus />}
3695+
/>,
3696+
);
3697+
3698+
const textbox = screen.getByRole('combobox');
3699+
3700+
expect(() => {
3701+
fireEvent.keyDown(textbox, { key: 'ArrowLeft' });
3702+
}).not.to.throw();
3703+
3704+
expect(textbox).toHaveFocus();
3705+
});
3706+
3707+
it('should not throw error on pressing ArrowLeft key with input text but no value in single value rendering', () => {
3708+
render(
3709+
<Autocomplete
3710+
options={['one', 'two', 'three']}
3711+
renderValue={(value, getItemProps) => {
3712+
return value ? <Chip label={value} {...getItemProps()} /> : null;
3713+
}}
3714+
renderInput={(params) => <TextField {...params} autoFocus />}
3715+
/>,
3716+
);
3717+
3718+
const textbox = screen.getByRole('combobox');
3719+
3720+
fireEvent.change(textbox, { target: { value: 'on' } });
3721+
3722+
expect(() => {
3723+
fireEvent.keyDown(textbox, { key: 'ArrowLeft' });
3724+
}).not.to.throw();
3725+
3726+
expect(textbox).to.have.property('value', 'on');
3727+
expect(textbox).toHaveFocus();
3728+
});
36863729
});
36873730

36883731
it('should not shrink the input label when value is an empty array in multiple mode using renderValue', () => {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ function useAutocomplete(props) {
853853
handleOpen(event);
854854
break;
855855
case 'ArrowLeft':
856-
if (!multiple && renderValue) {
856+
if (!multiple && renderValue && value != null) {
857857
focusItem(0);
858858
} else {
859859
handleFocusItem(event, 'previous');
File renamed without changes.
File renamed without changes.

scripts/buildLlmsDocs/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,14 @@ function findNonComponentMarkdownFiles(
264264
pathname.startsWith('/material-ui/') &&
265265
!ignoredPaths.some((ignored) => pathname.startsWith(ignored))
266266
) {
267-
const page = allMarkdownFiles.find((p) => p.pathname === parsedPathname);
267+
// Match by filename basename to avoid pathname collisions when multiple files
268+
// exist in the same directory (e.g., upgrade-to-v7.md and upgrade-to-native-color.md)
269+
const lastSegment = pathname.split('/').filter(Boolean).pop();
270+
const page = allMarkdownFiles.find((p) => {
271+
const fileBasename = path.basename(p.filename).replace(/\.mdx?$/, '');
272+
// p.pathname already has the parent path (from findPagesMarkdown which strips the filename)
273+
return fileBasename === lastSegment && p.pathname === parsedPathname;
274+
});
268275

269276
if (page) {
270277
files.push({

tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"allowSyntheticDefaultImports": true,
1414
"noErrorTruncation": false,
1515
"allowJs": true,
16-
"baseUrl": ".",
1716
"paths": {
1817
"@mui/material": ["./packages/mui-material/src"],
1918
"@mui/material/package.json": ["./packages/mui-material/package.json"],

0 commit comments

Comments
 (0)