Skip to content

Commit 08cb484

Browse files
committed
do not render empty tag list items
1 parent 119adde commit 08cb484

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
2121
- `Label` component
2222
- added `additionalElements` property to display elements at the end of the label
2323

24+
### Fixed
25+
26+
- `<TagList />`
27+
- do not create empty list items
28+
2429
## [24.0.1] - 2025-02-06
2530

2631
### Changed

src/components/Tag/TagList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ function TagList({ children, className = "", label = "", ...otherProps }: TagLis
1010
const tagList = (
1111
<ul className={`${eccgui}-tag__list` + (className && !label ? " " + className : "")} {...otherProps}>
1212
{React.Children.map(children, (child, i) => {
13-
return (
13+
return child ? (
1414
<li className={`${eccgui}-tag__list-item`} key={"tagitem_" + i}>
1515
{child}
1616
</li>
17-
);
17+
) : null;
1818
})}
1919
</ul>
2020
);

0 commit comments

Comments
 (0)