@hi-ui/tag-input 4.1.4 → 4.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @hi-ui/tag-input
2
2
 
3
+ ## 4.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#3450](https://github.com/XiaoMi/hiui/pull/3450) [`0cea4d7`](https://github.com/XiaoMi/hiui/commit/0cea4d75c771b5db56f520821b53864051c33594) Thanks [@zyprepare](https://github.com/zyprepare)! - fix(tag-input): ensure at least one tag is displayed when container width is insufficient (#3449)
8
+
3
9
  ## 4.1.4
4
10
 
5
11
  ### Patch Changes
@@ -98,7 +98,8 @@ var TagInputMock = /*#__PURE__*/React.forwardRef(function (_a, ref) {
98
98
  if (wrap) {
99
99
  return tagList;
100
100
  }
101
- return tagList.slice(0, Math.min(tagList.length, containerWidth / tagWidth));
101
+ var maxCount = Math.min(tagList.length, containerWidth / tagWidth);
102
+ return tagList.slice(0, maxCount < 1 ? 1 : maxCount);
102
103
  }, [tagList, tagWidth, containerWidth, wrap]);
103
104
  var showTags = mergedTagList.length > 0;
104
105
  var showTagCount = !wrap && showTags;
@@ -85,7 +85,8 @@ var TagInputMock = /*#__PURE__*/forwardRef(function (_a, ref) {
85
85
  if (wrap) {
86
86
  return tagList;
87
87
  }
88
- return tagList.slice(0, Math.min(tagList.length, containerWidth / tagWidth));
88
+ var maxCount = Math.min(tagList.length, containerWidth / tagWidth);
89
+ return tagList.slice(0, maxCount < 1 ? 1 : maxCount);
89
90
  }, [tagList, tagWidth, containerWidth, wrap]);
90
91
  var showTags = mergedTagList.length > 0;
91
92
  var showTagCount = !wrap && showTags;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hi-ui/tag-input",
3
- "version": "4.1.4",
3
+ "version": "4.1.5",
4
4
  "description": "A sub-package for @hi-ui/hiui.",
5
5
  "keywords": [],
6
6
  "author": "HiUI <mi-hiui@xiaomi.com>",