forked from sk1982/actaeon
chuni: fix music list column size when too small
This commit is contained in:
parent
b1c696e788
commit
4a813f80ca
@ -84,7 +84,7 @@ const MusicGrid = ({ music, size }: ChuniMusicListProps & { size: 'sm' | 'lg' })
|
|||||||
{({ height, isScrolling, onChildScroll, scrollTop }) =>
|
{({ height, isScrolling, onChildScroll, scrollTop }) =>
|
||||||
(<AutoSizer disableHeight>
|
(<AutoSizer disableHeight>
|
||||||
{({ width }) => {
|
{({ width }) => {
|
||||||
const itemsPerRow = Math.floor(width / itemWidth);
|
const itemsPerRow = Math.max(1, Math.floor(width / itemWidth));
|
||||||
const rowCount = Math.ceil(music.length / itemsPerRow);
|
const rowCount = Math.ceil(music.length / itemsPerRow);
|
||||||
|
|
||||||
return (<List rowCount={rowCount} autoHeight height={height} width={width} rowHeight={itemHeight} isScrolling={isScrolling}
|
return (<List rowCount={rowCount} autoHeight height={height} width={width} rowHeight={itemHeight} isScrolling={isScrolling}
|
||||||
|
Loading…
Reference in New Issue
Block a user