Skip to content

Commit

Permalink
fix: Do not render ellipses when the number of items is 0 (#48)
Browse files Browse the repository at this point in the history
Co-authored-by: NZ10387 <[email protected]>
  • Loading branch information
korkt-kim and NZ10387 authored Apr 16, 2024
1 parent 5c2fbf2 commit 6902b8f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/section/Ellipsis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export const EllipsisComp = <T extends object>({ isExpanded, value, keyName }: E
const child =
render && typeof render === 'function' && render({ ...reset, 'data-expanded': isExpanded }, { value, keyName });
if (child) return child;
if (!isExpanded) return null;

if (!isExpanded || (typeof value === 'object' && Object.keys(value).length == 0)) return null;
return <Elm {...reset} />;
};

Expand Down

0 comments on commit 6902b8f

Please sign in to comment.