Przeglądaj źródła

fix length property include "..." tail length (#1592)

niko 7 lat temu
rodzic
commit
7dbd7c40d2
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      src/components/Ellipsis/index.js

+ 1 - 1
src/components/Ellipsis/index.js

@@ -20,7 +20,7 @@ const EllipsisText = ({ text, length, tooltip, ...other }) => {
   if (length - tail.length <= 0) {
   if (length - tail.length <= 0) {
     displayText = '';
     displayText = '';
   } else {
   } else {
-    displayText = text.slice(0, length - tail.length);
+    displayText = text.slice(0, length);
   }
   }
 
 
   if (tooltip) {
   if (tooltip) {