Repository navigation
Conversation
…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.
Deploy previewBundle size
Check out the code infra dashboard for more information about this PR. |
This branch has not been deployed
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.
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 thelegend'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'smax-widthtransition (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
spana background color to mask the border, promoting thefieldsetto its own compositing layer viatransform: 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-widthtransition 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.