Skip to content

Commit

Permalink
fix: default to px when width/height is a number
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasgeiler committed Apr 20, 2024
1 parent 738d6d8 commit 62676d2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/VirtualList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,12 @@
const totalSize = sizeAndPositionManager.getTotalSize();
if (scrollDirection === DIRECTION.VERTICAL) {
wrapperStyle = `height:${height};width:${width};`;
const unit = typeof height === 'number' ? 'px' : '';
wrapperStyle = `height:${height}${unit};width:${width};`;
innerStyle = `flex-direction:column;height:${totalSize}px;`;
} else {
wrapperStyle = `height:${height};width:${width}`;
const unit = typeof width === 'number' ? 'px' : '';
wrapperStyle = `height:${height};width:${width}${unit}`;
innerStyle = `min-height:100%;width:${totalSize}px;`;
}
Expand Down

0 comments on commit 62676d2

Please sign in to comment.