Переглянути джерело

fix: issues 1560 Wrong number of tags after selection under ellipsisTrigger (#1859)

吃鱼的帆 2 роки тому
батько
коміт
efec02b1d9
1 змінених файлів з 3 додано та 1 видалено
  1. 3 1
      packages/semi-ui/select/index.tsx

+ 3 - 1
packages/semi-ui/select/index.tsx

@@ -1094,7 +1094,9 @@ class Select extends BaseComponent<SelectProps, SelectState> {
         const { maxTagCount } = this.props;
         const { maxTagCount } = this.props;
         const maxVisibleCount = selections.size - maxTagCount;
         const maxVisibleCount = selections.size - maxTagCount;
         const newOverFlowItemCount = maxVisibleCount > 0 ? maxVisibleCount + items.length - 1 : items.length - 1;
         const newOverFlowItemCount = maxVisibleCount > 0 ? maxVisibleCount + items.length - 1 : items.length - 1;
-        if (items.length > 1 && overflowItemCount !== newOverFlowItemCount) {
+
+        // fix: issues 1560
+        if (items.length >= 1 && overflowItemCount !== newOverFlowItemCount) {
             this.foundation.updateOverflowItemCount(selections.size, newOverFlowItemCount);
             this.foundation.updateOverflowItemCount(selections.size, newOverFlowItemCount);
         }
         }
     }
     }