Skip to content

[docs] Fix duplicate IDs and HTML validation issues#48095

Merged
Janpot merged 4 commits intomui:masterfrom
Janpot:fix/theme-viewer-duplicate-ids
Mar 30, 2026
Merged

[docs] Fix duplicate IDs and HTML validation issues#48095
Janpot merged 4 commits intomui:masterfrom
Janpot:fix/theme-viewer-duplicate-ids

Conversation

@Janpot
Copy link
Copy Markdown
Member

@Janpot Janpot commented Mar 25, 2026

Summary

Caught in #48088

  • ThemeViewer: Use React.useId() instead of hardcoded $ROOT prefix so multiple instances (collapsed/expanded views on default-theme page) don't produce duplicate IDs. (https://deploy-preview-48095--material-ui.netlify.app/material-ui/customization/default-theme/)
  • SearchButton: Use React.useId() instead of hardcoded app-search-label ID so multiple instances (AppHeader and AppFrame) don't conflict.
  • BackToTop: Move Tooltip inside the positioning Box so aria-label lands on the Fab (interactive) instead of a wrapper div.
  • ToggleDisplayOption: Use React.useId() for unique IDs per instance, and fix aria-controls to reference the menu ID instead of the button's own ID.

Use React.useId() instead of a hardcoded '$ROOT' prefix so that
multiple ThemeViewer instances on the same page (e.g. collapsed
and expanded views on /material-ui/customization/default-theme)
produce unique element IDs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mui-bot
Copy link
Copy Markdown

mui-bot commented Mar 25, 2026

Netlify deploy preview

https://deploy-preview-48095--material-ui.netlify.app/

Bundle size report

Bundle Parsed size Gzip size
@mui/material 0B(0.00%) 0B(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 c794a35

@Janpot Janpot added the scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). label Mar 25, 2026
@Janpot Janpot changed the title [docs] Fix duplicate IDs in ThemeViewer [docs-infra] Fix duplicate IDs in ThemeViewer Mar 25, 2026
@Janpot Janpot requested review from a team and dav-is March 25, 2026 12:21
Janpot and others added 3 commits March 25, 2026 13:58
Use React.useId() instead of a hardcoded 'app-search-label' ID so that
multiple SearchButton instances (AppHeader and AppFrame) don't produce
duplicate IDs in the DOM.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move Tooltip inside the positioning Box so it wraps the Fab directly.
This prevents aria-label from being applied to a non-interactive div.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use React.useId() for unique IDs per instance, and fix aria-controls
to reference the menu ID instead of the button's own ID.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Janpot Janpot changed the title [docs-infra] Fix duplicate IDs in ThemeViewer [docs] Fix duplicate IDs and HTML validation issues Mar 25, 2026
Janpot added a commit to Janpot/material-ui that referenced this pull request Mar 26, 2026
Cherry-pick fixes from mui#48107 and mui#48095:
- Replace <span> with <div> for dangerouslySetInnerHTML with block content
- Fix StyledIcon from span to div on material-icons page
- Use inline elements in ProductsSwitcher for valid span nesting
- Fix duplicate IDs in ThemeViewer, SearchButton, ToggleDisplayOption
- Fix aria-label misuse on BackToTop wrapper div
- Fix wrong aria-controls in ToggleDisplayOption

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Janpot Janpot merged commit cde51b6 into mui:master Mar 30, 2026
23 checks passed
Janpot added a commit to Janpot/material-ui that referenced this pull request Mar 30, 2026
Cherry-pick fixes from mui#48107 and mui#48095:
- Replace <span> with <div> for dangerouslySetInnerHTML with block content
- Fix StyledIcon from span to div on material-icons page
- Use inline elements in ProductsSwitcher for valid span nesting
- Fix duplicate IDs in ThemeViewer, SearchButton, ToggleDisplayOption
- Fix aria-label misuse on BackToTop wrapper div
- Fix wrong aria-controls in ToggleDisplayOption

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants