Skip to content

Commit a74c326

Browse files
authored
SortableGridList - fix rounding issue that causes less items to be shown in each row (#3274)
1 parent ee78a0b commit a74c326

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/gridList/useGridLayout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const useGridLayout = (props: GridListBaseProps) => {
3737
}, [numColumns, maxItemWidth, itemSpacing, keepItemSize ? _containerWidth : undefined]);
3838

3939
const itemWidth = useMemo(() => {
40-
return (_containerWidth - itemSpacing * (numberOfColumns - 1)) / numberOfColumns;
40+
return Math.floor((_containerWidth - itemSpacing * (numberOfColumns - 1)) / numberOfColumns);
4141

4242
// eslint-disable-next-line react-hooks/exhaustive-deps
4343
}, [numberOfColumns, itemSpacing, keepItemSize ? undefined : _containerWidth]);

0 commit comments

Comments
 (0)