Skip to content

Commit dc52beb

Browse files
shakyShaneShane Osbourne
andauthored
ntp: fix favorites container when expanded+few items (#1306)
Co-authored-by: Shane Osbourne <[email protected]>
1 parent 9322e51 commit dc52beb

File tree

1 file changed

+5
-1
lines changed
  • special-pages/pages/new-tab/app/favorites/components

1 file changed

+5
-1
lines changed

special-pages/pages/new-tab/app/favorites/components/Favorites.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,11 @@ function VirtualizedGridRows({ WIDGET_ID, rowHeight, favorites, expansion, openF
122122
// get a ref for the favorites' grid, this will allow it to receive drop events,
123123
// and the ref can also be used for reading the offset (eg: if other elements are above it)
124124
const safeAreaRef = /** @type {import("preact").RefObject<HTMLDivElement>} */ (useDropzoneSafeArea());
125-
const containerHeight = expansion === 'collapsed' ? rowHeight : rows.length * rowHeight;
125+
126+
// prettier-ignore
127+
const containerHeight = expansion === 'collapsed' || rows.length === 0
128+
? rowHeight
129+
: rows.length * rowHeight;
126130

127131
return (
128132
<div

0 commit comments

Comments
 (0)