fix(mui): apply Link styling props to MuiLink instead of span in Breadcrumb#7464
Open
Purav-Kanda wants to merge 1 commit into
Open
fix(mui): apply Link styling props to MuiLink instead of span in Breadcrumb#7464Purav-Kanda wants to merge 1 commit into
Purav-Kanda wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: a655fd4 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #7462
#7463 already proposes the same one-line fix, but adds no test coverage. The issue itself calls out that the existing
breadcrumbTestssuite only checks structure (text/href/icon), never styling — which is exactly why this regression shipped unnoticed. This PR includes the fix and closes that gap with a regression test that fails against the buggy<span>implementation and passes against the fix.What's the problem?
@refinedev/mui'sBreadcrumbrenders links through an internalLinkRouterhelper, typed to accept MUILinkProps(sx,underline,color,variant) but spreading them onto a bare<span>instead of an MUI component — so the props do nothing and leak as invalid DOM attributes (e.g.sx="[object Object]").Regression from the v5 migration (#6945, commit 5d63ada), which rewrote
LinkRouterfor the newuseLink()API but never re-wired the styling props to an actual MUI component.Fix
Wrap the content in MUI's real
Link(component="span"to avoid nesting two<a>tags, same precaution as #7428):Test added
packages/mui/src/components/breadcrumb/index.spec.tsxasserts the rendered link's inner element carries theMuiLink-rootclass and that none ofsx/underline/color/variantleak through as literal DOM attributes.Checklist
pnpm testinpackages/mui— 420 passed, 4 pre-existing/unrelated failures: timezone-dependentDateFieldtests and a flakyuseDataGridtimeout, neither touched by this change)