Skip to content

Commit 47cd922

Browse files
committed
feat: fix emoji truncation issue abute Ellipsis
1 parent 7b59074 commit 47cd922

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

packages/arcodesign/components/ellipsis/components/js-ellipsis.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ const JsEllipsis = forwardRef((props: JsEllipsisProps, ref: Ref<JsEllipsisRef>)
6767
l = m;
6868
}
6969
}
70+
// Remove the last character if it has a emoji character.
71+
currentText = currentText.replace(/[\uD800-\uDBFF]+$/g, '');
7072
// Remove the exclude char at the end of the content.
7173
while (endExcludes && endExcludes.includes(currentText[currentText.length - 1])) {
7274
currentText = currentText.slice(0, -1);

0 commit comments

Comments
 (0)