close
Skip to content

[ListItemIcon] Use theme spacing instead of hardcoded minWidth#46597

Merged
mj12albert merged 7 commits intomui:masterfrom
adiitxa:fix-listitemicon-width
Mar 30, 2026
Merged

[ListItemIcon] Use theme spacing instead of hardcoded minWidth#46597
mj12albert merged 7 commits intomui:masterfrom
adiitxa:fix-listitemicon-width

Conversation

@adiitxa
Copy link
Copy Markdown
Contributor

@adiitxa adiitxa commented Jul 25, 2025

Summary

This PR replaces the hardcoded minWidth: 56px in ListItemIcon with theme.spacing(4.5) (36px), aligning spacing with other components like MenuItem. This ensures consistent theming and avoids layout inconsistencies.

This issue is visible in the MUI here:
👉 https://mui.com/material-ui/react-list/#nested-list
(Nested ListItemIcon shows inconsistent spacing due to hardcoded minWidth)

Fixes

Closes #46596
Ensures icon spacing is responsive and theme-consistent.

Testing

  • Verified visually in local Storybook and MUI docs (List, Menu)
  • Confirmed spacing updates across RTL and default themes

Screenshots

🔴 Before

bug

✅ After

Fixed

Checklist

  • Follows MUI theme conventions
  • No hardcoded styles
  • Visual regression verified
  • Added screenshot proof

@mui-bot
Copy link
Copy Markdown

mui-bot commented Jul 25, 2025

Netlify deploy preview

Bundle size report

Bundle Parsed size Gzip size
@mui/material 🔺+12B(0.00%) 🔺+5B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 2b0bdec

@adiitxa
Copy link
Copy Markdown
Contributor Author

adiitxa commented Jul 25, 2025

Hi! This PR fixes #46596
Could a maintainer please add the appropriate test label (test:skip or test:done) to pass the required check? This fix is purely visual
could you please add a test label here? 🙏

Thanks!

@zannager zannager added scope: list Changes related to the list test labels Jul 26, 2025
@zannager zannager requested a review from siriwatknp July 26, 2025 06:47
@adiitxa adiitxa changed the title fix(ListItemIcon): replaced hardcoded minWidth with theme.spacing fix(ListItemIcon): use theme.spacing instead of hardcoded minWidth Jul 27, 2025
@adiitxa
Copy link
Copy Markdown
Contributor Author

adiitxa commented Jul 27, 2025

Hi @ZeeshanTamboli
PR aligns ListItemIcon spacing with theme.spacing(4.5). Verified with screenshots.

review when you get a chance. Thanks! 🙏

@siriwatknp siriwatknp added on hold There is a blocker, we need to wait. breaking change Introduces changes that are not backward compatible. labels Jul 28, 2025
@siriwatknp
Copy link
Copy Markdown
Member

Thanks for submitting the PR. It's definitely better to me but it's a breaking change so I don't think this can be slot in v7. I'll keep this open.

@mj12albert mj12albert added v9.x and removed v8.x labels Mar 29, 2026
@mj12albert mj12albert removed the on hold There is a blocker, we need to wait. label Mar 29, 2026
@mj12albert
Copy link
Copy Markdown
Member

@silviuaavram @siriwatknp I think it's not too late to include this tiny breaking change for v9

Copy link
Copy Markdown
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Totally agree

@siriwatknp
Copy link
Copy Markdown
Member

@silviuaavram @siriwatknp I think it's not too late to include this tiny breaking change for v9

Good one.

@mj12albert mj12albert changed the title fix(ListItemIcon): use theme.spacing instead of hardcoded minWidth [ListItemIcon] Use theme spacing instead of hardcoded minWidth Mar 30, 2026
@mj12albert mj12albert enabled auto-merge (squash) March 30, 2026 08:43
Comment thread docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md Outdated
Signed-off-by: Siriwat K <siriwatkunaporn@gmail.com>
@mj12albert mj12albert merged commit ceb6c4b into mui:master Mar 30, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Introduces changes that are not backward compatible. scope: list Changes related to the list v9.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hardcoded width in ListItemIcon

5 participants