diff --git a/src/app/shared/truncatable/truncatable-part/truncatable-part.component.ts b/src/app/shared/truncatable/truncatable-part/truncatable-part.component.ts index b5db493ffa9..074dadfde32 100644 --- a/src/app/shared/truncatable/truncatable-part/truncatable-part.component.ts +++ b/src/app/shared/truncatable/truncatable-part/truncatable-part.component.ts @@ -127,24 +127,10 @@ export class TruncatablePartComponent implements AfterViewChecked, OnInit, OnDes public truncateElement() { if (this.showToggle) { const entry = this.content.nativeElement; - if (entry.scrollHeight > entry.offsetHeight) { - if (entry.children.length > 0) { - if (entry.children[entry.children.length - 1].offsetHeight > entry.offsetHeight) { - entry.classList.add('truncated'); - entry.classList.remove('removeFaded'); - } else { - entry.classList.remove('truncated'); - entry.classList.add('removeFaded'); - } - } else { - if (entry.innerText.length > 0) { - entry.classList.add('truncated'); - entry.classList.remove('removeFaded'); - } else { - entry.classList.remove('truncated'); - entry.classList.add('removeFaded'); - } - } + const isOverflowing = entry.scrollHeight > entry.clientHeight; + if (isOverflowing) { + entry.classList.add('truncated'); + entry.classList.remove('removeFaded'); } else { entry.classList.remove('truncated'); entry.classList.add('removeFaded');