You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[text field] Visual bug on outlined label in Safari #46891
@simon-thuresson-md Do you have other CSS customizations? Testing in Safari 18.6 the transition is little bit off but when it's settled it's still OK unlike your screenshot
Right! I feel like that is a symptom of the same problem though, there is definitely a visual bug no? So my feeling is that would still be an issue no?
If you past that in the codesandbox, you can reproduce my second picture from the description where the outline goes missing. Though, if you remove the translate it isnt that bad, more like your video. I cant tell what that means though, or if it should be related? I mean it works on chrome and firefox without issuse?
I have not yet reproduced the example in the first picture as easy, cant really copy our entire codebase :)
I think it is worth noting that this is NOT only on TextField component, I have seen the same bug on Select as well as DatePicker. Using the example and change to Select will reproduce
"I believe the issue is using Modal with transform,"
I am not sure I follow you @Jayesh-11 . The main issue, as I see it, is using an outlined component inside a Stack component causes it to render the label badly. The use of a Modal was only to demonstrate the issue more clearly. If you would remove the use of Modal in your example, the component would still render badly (though not as bad). So I would say your "solution" is only a fix to the symptom, not the problem itself. As I mentioned in the description. the use of:
import * as React from 'react';
import TextField from '@mui/material/TextField';
import { Box, Stack } from '@mui/material';
export default function BasicTextFields() {
return (
<Box>
<Stack>
<TextField label="Standard" variant="outlined" />
</Stack>
</Box>
);
}
isolated modal + stack + box - seems to be working fine
import * as React from 'react';
import TextField from '@mui/material/TextField';
import Stack from '@mui/material/Stack';
import Modal from '@mui/material/Modal';
export default function BasicTextFields() {
return (
<Modal open={true} onClose={() => {}}>
<Stack>
<TextField
label="Standard"
variant="outlined"
sx={{ border: '5px solid transparent' }}
/>
</Stack>
</Modal>
);
}
The issue seems to be visible when transform is involved for me at atleast
as mentioned here the issue is the one where the fieldset is completely empty
so targetting that if we remove tranform, I wasn't able to reproduce the original mentioned issue without transform
@Jayesh-11 Hmm, are you checking on Safari? If you only have a Stack with an outlined textfield there is a visual bug. Not as apparent though as if you also have it inside the modal I provided as well.
When I see the bug on safari with stack and outlined textfield, it goes away when i use a box.
I am facing similar issue on MUI version: v5.1.0, and it is also reproducible on MUI latest version too.
Cause: I find out issue is happening when we add placeholder to TextField.
Steps to reproduce:
Add Textfield with placeholder="some text", adding variant="outlined" is optional.
<TextFieldid="outlined-basic"label="I have an issue"variant="outlined"placeholder="I cause issue"sx={{'& legend': {// Uncomment one below property to apply fix// visibility: 'visible', // transition: 'none'}}}/>
I have the same issue with the outlined Textfield. I noticed that for me it is only happening when the Textfield is part of a dialog.
I use @mui/material": "^7.3.4" .
It is indeed fixed when adding the suggestion by @simon-thuresson-md . Thanks!
Activity
mj12albert commentedon Sep 9, 2025
@simon-thuresson-md Do you have other CSS customizations? Testing in Safari 18.6 the transition is little bit off but when it's settled it's still OK unlike your screenshot
Screen.Recording.2025-09-09.at.10.34.38.AM.mov
https://codesandbox.io/p/sandbox/frosty-burnell-3mgqt6
simon-thuresson-md commentedon Sep 9, 2025
Right! I feel like that is a symptom of the same problem though, there is definitely a visual bug no? So my feeling is that would still be an issue no?
Anyways, I managed to refine the example to this:
If you past that in the codesandbox, you can reproduce my second picture from the description where the outline goes missing. Though, if you remove the translate it isnt that bad, more like your video. I cant tell what that means though, or if it should be related? I mean it works on chrome and firefox without issuse?
I have not yet reproduced the example in the first picture as easy, cant really copy our entire codebase :)
simon-thuresson-md commentedon Sep 9, 2025
I think it is worth noting that this is NOT only on
TextFieldcomponent, I have seen the same bug onSelectas well asDatePicker. Using the example and change toSelectwill reproducejknight12882 commentedon Sep 10, 2025
+1 also able to reproduce this issue
Jayesh-11 commentedon Sep 13, 2025
Hi @simon-thuresson-md this might help
I believe the issue is using
Modalwith transform,instead this workaround for webkit
or
Here the code for reference
Reference
output.mov
simon-thuresson-md commentedon Sep 15, 2025
I am not sure I follow you @Jayesh-11 . The main issue, as I see it, is using an outlined component inside a
Stackcomponent causes it to render the label badly. The use of aModalwas only to demonstrate the issue more clearly. If you would remove the use ofModalin your example, the component would still render badly (though not as bad). So I would say your "solution" is only a fix to the symptom, not the problem itself. As I mentioned in the description. the use of:Solves the problem, but I would say it only solves the symptom.
But maybe I miss understood you? :)
Jayesh-11 commentedon Sep 19, 2025
@simon-thuresson-md
maybe I am missing something but just using stack with outlined textfield seems to be working fine
hence ruling out isolated Stack component maybe -> correct me if am missing something here
https://stackblitz.com/edit/vitejs-vite-jykxmjbe?file=src%2FApp.tsx
isolated with box also works fine - https://stackblitz.com/edit/vitejs-vite-45pfwrxj?file=src%2FApp.tsx
isolated modal + stack + box - seems to be working fine
The issue seems to be visible when transform is involved for me at atleast
as mentioned here the issue is the one where the fieldset is completely empty
so targetting that if we remove tranform, I wasn't able to reproduce the original mentioned issue without
transformsimon-thuresson-md commentedon Sep 19, 2025
@Jayesh-11 Hmm, are you checking on Safari? If you only have a Stack with an outlined textfield there is a visual bug. Not as apparent though as if you also have it inside the modal I provided as well.
When I see the bug on safari with stack and outlined textfield, it goes away when i use a box.
This is using your stackblitz on Safari:
Skarminspelning.2025-09-19.kl.10.33.40.mov
It is also there if i have:
Jayesh-11 commentedon Sep 19, 2025
Thanks for quick response!
yes that minor issue is visible in safari
but because of this comment I was not addressing that issue
was more working towards fixing this issue as shown here which is highlighted in safari with the code you shared here
Mustajabgohar commentedon Sep 23, 2025
I am facing similar issue on MUI version: v5.1.0, and it is also reproducible on MUI latest version too.
Cause: I find out issue is happening when we add placeholder to TextField.
Steps to reproduce:
placeholder="some text", addingvariant="outlined"is optional.@simon-thuresson-md suggested solution here works correctly.
Earlier, I also had applied a quick fix the issue, sharing the fix in case it might help @muibot to dive deep down the issue:
patriciam97 commentedon Nov 2, 2025
I have the same issue with the outlined Textfield. I noticed that for me it is only happening when the Textfield is part of a dialog.
I use @mui/material": "^7.3.4" .
It is indeed fixed when adding the suggestion by @simon-thuresson-md . Thanks!
[-]Visual bug on outlined label in Safari[/-][+][text field] Visual bug on outlined label in Safari[/+]fix: 修复 iOS Safari 商家表单标签被边框遮挡 (#707)
UV-19: Fix broken outlined-label rendering in member form selects (#28)
BaranDev commentedon Nov 26, 2026
still reproducable