fix: apply masterSize to master area even without detail content#11147
fix: apply masterSize to master area even without detail content#11147DiegoCardoso wants to merge 1 commit intomainfrom
Conversation
) Remove [has-detail] requirement from CSS selectors that set master width/height from masterSize. Without this fix, elements inside the master area that lack intrinsic size (like vaadin-grid) collapse to zero width when no detail content is present. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
There was a problem hiding this comment.
Currently, the master expands once you open the detail, which looks quite jarring:
Bildschirmaufnahme.2026-02-17.um.07.18.56.mov
But keeping the master on a fixed size when the details are displayed as an overlay is also weird. I think I would expect that if the details are going to be opened as an overlay, the master size would still cover the full size. It would only respect the width if details would be shown next to it. The problem with that is that we can only detect that once the details are actually added to the DOM, otherwise we have nothing to measure.
ping @rolfsmeds
There was a problem hiding this comment.
Hmm, that (the master becoming full-size again once the detail goes overlay) is an issue also with a non-fixed-size master (it looks a bit jarring regardless, because at that point the master has already shrunk down to its min-size).
It would probably look better if the detail popping out didn't affect the size of the master, but with a semitransparent detail, it might look weird that there's just empty space next to the master? But maybe that would still be better?
If we change this, it would mean that
- With a fixed-size master, the master would always be exactly that size (except if viewport is smaller)
- With an auto-sized master (with a min-size), the master would be fixed to its min-size when the detail is overlay.



Summary
[has-detail]requirement from CSS selectors that set masterwidth/heightfrommasterSize, so the master area respects its fixed size even when no detail content is presentFixes #10318
Root Cause
The CSS selectors applying
masterSizeto the master part required[has-detail]:Without detail content,
has-detailis absent, so thewidth/heightrules never applied. Combined withflex-shrink: 0(which IS applied) and noflex-grow/flex-basis(blocked byhas-master-size), the master ended up with no sizing — causing children without intrinsic size (e.g.,<vaadin-grid>) to collapse to zero.Fix
Removed
[has-detail]from the two selectors. This is safe because:max-width: 100%/max-height: 100%on[part]prevents overflow!importantoverrides in drawer/stack mode are unaffectedTest plan
400pxwidth without detail200pxheight without detaildev/mdl-size.html— grid should have 400px width🤖 Generated with Claude Code