Skip to content

[TextField] Fix Safari outlined notch expansion in flex layouts#48566

Open
maxmorlocke wants to merge 3 commits into
mui:masterfrom
maxmorlocke:fix-ios-notch-issue
Open

[TextField] Fix Safari outlined notch expansion in flex layouts#48566
maxmorlocke wants to merge 3 commits into
mui:masterfrom
maxmorlocke:fix-ios-notch-issue

Conversation

@maxmorlocke
Copy link
Copy Markdown

@maxmorlocke maxmorlocke commented May 23, 2026

This fixes a Safari/WebKit rendering bug where the outlined TextField notch fails to expand correctly in flex layouts (commonly reproduced with Stack), causing the floating label to overlap the top border.

The root cause is WebKit’s handling of percentage max-width on legend inside fieldset in this layout scenario. To my knowledge, this:

I updated OutlinedInput notch expansion style to avoid percentage max-width in the notched state ('100%' maxWidth: '100%' → 'none'). Using this approach keeps behavior consistent across browsers while specifically addressing Safari/WebKit and does not rely on any hardcoded values for width and should not change behavior.

I added a test that reproduces this flex layout scenario and asserts the notch expands on focus. I also added an e2e test on this scenario. These tests (and any tests that failed due to this change) now test on behavior, not on a strictly computed style. I find this makes for more robust tests, but I am happy to change if this is problematic.

@code-infra-dashboard
Copy link
Copy Markdown

code-infra-dashboard Bot commented May 23, 2026

Deploy preview

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

Bundle size

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[text field] Visual bug on outlined label in Safari Display glitch when using multiline in TextField

1 participant