Skip to content

Commit

Permalink
revert: Revert "fix: Empty div keep its padding caused a big gap"
Browse files Browse the repository at this point in the history
This reverts commit 57f7ffe.
  • Loading branch information
null2264 committed Oct 21, 2023
1 parent 57f7ffe commit aa32822
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/soapbox/components/scrollable-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,9 @@ type SavedScrollPosition = {
// NOTE: It's crucial to space lists with **padding** instead of margin!
// Pass an `itemClassName` like `pb-3`, NOT a `space-y-3` className
// https://virtuoso.dev/troubleshooting#list-does-not-scroll-to-the-bottom--items-jump-around
const Item: Components<JSX.Element, Context>['Item'] = ({ context, ...rest }) => {
// TODO: 12 is a magic number for assumed empty data, not sure any other way to check null component
if (rest['data-known-size'] <= 12) return null;
return (
<div className={context?.itemClassName} {...rest} />
);
};
const Item: Components<JSX.Element, Context>['Item'] = ({ context, ...rest }) => (
<div className={context?.itemClassName} {...rest} />
);

/** Custom Virtuoso List component for the outer container. */
// Ensure the className winds up here
Expand Down

0 comments on commit aa32822

Please sign in to comment.