From 98a78b2c53946c0fc2c83d57b0bb7ad34851702a Mon Sep 17 00:00:00 2001 From: Ovilia Date: Tue, 18 Apr 2023 15:48:16 +0800 Subject: [PATCH] fix(label): ellipsis was not working --- src/label/labelStyle.ts | 2 +- src/util/types.ts | 2 + test/label-ellipsis.html | 110 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 test/label-ellipsis.html diff --git a/src/label/labelStyle.ts b/src/label/labelStyle.ts index cd5f8c4a69..3d6740a372 100644 --- a/src/label/labelStyle.ts +++ b/src/label/labelStyle.ts @@ -460,7 +460,7 @@ const TEXT_PROPS_WITH_GLOBAL = [ 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY' ] as const; const TEXT_PROPS_SELF = [ - 'align', 'lineHeight', 'width', 'height', 'tag', 'verticalAlign' + 'align', 'lineHeight', 'width', 'height', 'tag', 'verticalAlign', 'ellipsis' ] as const; const TEXT_PROPS_BOX = [ 'padding', 'borderWidth', 'borderRadius', 'borderDashOffset', diff --git a/src/util/types.ts b/src/util/types.ts index 6f135e83a1..4459570436 100644 --- a/src/util/types.ts +++ b/src/util/types.ts @@ -1056,6 +1056,8 @@ export interface LabelOption extends TextCommonOption { minMargin?: number overflow?: TextStyleProps['overflow'] + ellipsis?: TextStyleProps['ellipsis'] + silent?: boolean precision?: number | 'auto' valueAnimation?: boolean diff --git a/test/label-ellipsis.html b/test/label-ellipsis.html new file mode 100644 index 0000000000..04b3b15dad --- /dev/null +++ b/test/label-ellipsis.html @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +