Material UI's fullWidth
input field isn't displaying the label text correctly.
Here is a trimmed & static reproducible example where the fullWidth
text shows in Chrome, but not Ladybird:
<!DOCTYPE html><style>
.outer {
display: flex;
}
.middle {
width: 500px;
}
.inner {
position: relative;
width: 100%;
}
label {
position: absolute;
overflow: hidden;
max-width: 100%;
}
</style>
<body><div class="outer"><div class="middle"><div class="inner"><label>fullWidth</label>
The reason the label is gone is because the width of label
has been determined to be 0px, and overflow: hidden
is trimming it all away. I've tried getting to the bottom of this issue, but I've struggled to wrap my brain around how the FFC is participating. As far as I can tell, the following steps are leading to the issue:
.outer
lays out .middle
, and calculates min/max content sizes using calculate_{min,max}_content_width
calculate_{min,max}_content_width
sets .middle
's width to be indefinite..middle
's width is (temporarily) indefinite, .inner
's width isn't set to 500px like it is if .outer
is a BFC..inner
's width is calculated to be 0pxlabel
is laid out using .inner
as its containing box (due to the position styles I think), which has a width of 0px.label
's containing block is 0px, the max-width
style trims its width to also be 0px.label
decides its width is now "definite" at 0px.inner
's width to be 500px.label
is re-laid out, but since its width has already been determined to be "definite", it does not re-calculate using the new max-width
.IF the above steps are accurate, I'm also struggling to understand what the correct solution here is. Should the width of .inner
never be calculated to be 0px (step 4)? Should label always re-calculate width (step 9)?
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too