mirror of
https://github.com/navidrome/navidrome.git
synced 2026-08-01 07:21:17 +00:00
fix(ui): stop the album grid blanking its covers on refresh
Cover takes its height from react-measure, which reports nothing until it re-measures. That was harmless while the cover class sat on the img itself, which has intrinsic size; it now sits on the Artwork root, whose img fills it absolutely and so lends no height. A refresh remounts the tiles, and for the frame before measurement lands the box collapsed to zero and every cover vanished. Give the box its own aspect ratio as a floor. The measured height still wins once it arrives.
This commit is contained in:
parent
3ce4a018e0
commit
97035c4e1c
@ -104,6 +104,9 @@ const useCoverStyles = makeStyles({
|
||||
display: 'inline-block',
|
||||
width: '100%',
|
||||
objectFit: 'contain',
|
||||
// The image fills this box absolutely, so it lends no height: a remount that has not been
|
||||
// re-measured yet would collapse the tile and blank the cover for a frame.
|
||||
aspectRatio: '1',
|
||||
height: (props) => props.height,
|
||||
transition: 'opacity 0.3s ease-in-out',
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user