Skip to content

Commit

Permalink
fix order
Browse files Browse the repository at this point in the history
  • Loading branch information
amcdnl committed Aug 14, 2024
1 parent d2313e3 commit 9971548
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/data/Ellipsis/Ellipsis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ export const Ellipsis: FC<EllipsisProps> = ({
}, [expandable, limit, value, removeLinebreaks]);

const measureText = useCallback(() => {
if (!contentRef.current) {
return;
}

if (lines === undefined) {
if (substr.length !== value.length) {
setTruncatedText(substr);
Expand All @@ -102,6 +98,10 @@ export const Ellipsis: FC<EllipsisProps> = ({
return;
}

if (!contentRef.current) {
return;
}

const content = contentRef.current;
const lineHeight = parseInt(window.getComputedStyle(content).lineHeight);
const maxHeight = lines ? lineHeight * lines : content.clientHeight;
Expand Down

0 comments on commit 9971548

Please sign in to comment.