Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions packages/react-core/src/components/LabelGroup/LabelGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,14 @@ export class LabelGroup extends React.Component<LabelGroupProps, LabelGroupState
...rest
} = this.props;
const { isOpen } = this.state;
const numChildren = React.Children.count(children);
const renderedChildren = React.Children.toArray(children);
const numChildren = renderedChildren.length;
const collapsedTextResult = fillTemplate(collapsedText as string, {
remaining: React.Children.count(children) - numLabels
remaining: numChildren - numLabels
});

const renderLabelGroup = (id: string) => {
const labelArray = !isOpen
? React.Children.toArray(children).slice(0, numLabels)
: React.Children.toArray(children);
const labelArray = !isOpen ? renderedChildren.slice(0, numLabels) : renderedChildren;

const content = (
<React.Fragment>
Expand Down