Skip to content

Fix Safari repaint bug where notched outline border shows through shrunk label - #49473

Open
SaebAmini wants to merge 1 commit into
mui:masterfrom
SaebAmini:fix/safari-notched-outline-legend-repaint
Open

SaebAmini wants to merge 1 commit into
mui:masterfrom
SaebAmini:fix/safari-notched-outline-legend-repaint

Conversation

@SaebAmini

@SaebAmini SaebAmini commented Oct 16, 2026 •

Copy link
Copy Markdown

Bug

On Safari (desktop and iOS/WKWebView), the OutlinedInput/notched-outline label sometimes renders with the fieldset's border running straight through the shrunk label text — visually looking like the label has a strikethrough — instead of the border being cleanly cut by the legend's notch.

This happens intermittently, most commonly the first time a given field's label shrinks (e.g. on initial focus, or when a field mounts already populated), and reliably self-resolves as soon as there's any further interaction with the page (typing, scrolling, etc.) that forces a reflow/repaint. That pattern — broken only transiently, fixed by any subsequent layout work — points to Safari failing to repaint the notch cut at the exact moment the legend's max-width transition (used to animate the notch open) finishes, rather than a persistent layout bug.

I ran into this in my own app and tried a couple of other workarounds first (giving the legend's span a background color to mask the border, promoting the fieldset to its own compositing layer via transform: translateZ(0)), neither of which resolved it. Disabling the transition entirely is what fixed it reliably, which also supports the "stuck mid-transition paint" theory.

Fix

Disable the notch's max-width transition specifically on Safari/WebKit via the common @supports (-webkit-hyphens: none) feature-query hack, so the notch still resizes correctly but snaps instantly instead of animating — avoiding the broken intermediate frame. Other browsers keep the existing animation unchanged.

…abel

Disable the legend's max-width transition on Safari/WebKit, where the
fieldset's notch cut is intermittently not repainted when the transition
ends, leaving the border visible through the label until the next
interaction forces a reflow.
@code-infra-dashboard

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-49473--material-ui.netlify.app/
QR code for https://deploy-preview-49473--material-ui.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/material 🔺+56B(+0.01%) 🔺+27B(+0.02%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 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


Check out the code infra dashboard for more information about this PR.

@zannager zannager added the scope: text field Changes related to the text field. label Oct 20, 2026
@zannager
zannager requested a review from siriwatknp October 20, 2026 15:36

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: text field Changes related to the text field.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants