@rc-component/select 1.6.11 → 1.6.12

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.
@@ -16,7 +16,8 @@ const SingleContent = /*#__PURE__*/React.forwardRef(({
16
16
  activeValue,
17
17
  displayValues,
18
18
  maxLength,
19
- mode
19
+ mode,
20
+ components
20
21
  } = useSelectInputContext();
21
22
  const {
22
23
  triggerOpen,
@@ -68,7 +69,9 @@ const SingleContent = /*#__PURE__*/React.forwardRef(({
68
69
  const showHasValueCls = displayValue && displayValue.label !== null && displayValue.label !== undefined && String(displayValue.label).trim() !== '';
69
70
 
70
71
  // Render value
71
- const renderValue = displayValue ? hasOptionStyle ? /*#__PURE__*/React.createElement("div", {
72
+ // Only render value when not using custom input in combobox mode
73
+ const shouldRenderValue = !(combobox && components?.input);
74
+ const renderValue = shouldRenderValue ? displayValue ? hasOptionStyle ? /*#__PURE__*/React.createElement("div", {
72
75
  className: clsx(`${prefixCls}-content-value`, optionClassName),
73
76
  style: {
74
77
  ...(mergedSearchValue ? {
@@ -79,8 +82,7 @@ const SingleContent = /*#__PURE__*/React.forwardRef(({
79
82
  title: optionTitle
80
83
  }, displayValue.label) : displayValue.label : /*#__PURE__*/React.createElement(Placeholder, {
81
84
  show: !mergedSearchValue
82
- });
83
-
85
+ }) : null;
84
86
  // Render
85
87
  return /*#__PURE__*/React.createElement("div", {
86
88
  className: clsx(`${prefixCls}-content`, showHasValueCls && `${prefixCls}-content-has-value`, mergedSearchValue && `${prefixCls}-content-has-search-value`, hasOptionStyle && `${prefixCls}-content-has-option-style`, classNames?.content),
@@ -25,7 +25,8 @@ const SingleContent = /*#__PURE__*/React.forwardRef(({
25
25
  activeValue,
26
26
  displayValues,
27
27
  maxLength,
28
- mode
28
+ mode,
29
+ components
29
30
  } = (0, _context.useSelectInputContext)();
30
31
  const {
31
32
  triggerOpen,
@@ -77,7 +78,9 @@ const SingleContent = /*#__PURE__*/React.forwardRef(({
77
78
  const showHasValueCls = displayValue && displayValue.label !== null && displayValue.label !== undefined && String(displayValue.label).trim() !== '';
78
79
 
79
80
  // Render value
80
- const renderValue = displayValue ? hasOptionStyle ? /*#__PURE__*/React.createElement("div", {
81
+ // Only render value when not using custom input in combobox mode
82
+ const shouldRenderValue = !(combobox && components?.input);
83
+ const renderValue = shouldRenderValue ? displayValue ? hasOptionStyle ? /*#__PURE__*/React.createElement("div", {
81
84
  className: (0, _clsx.clsx)(`${prefixCls}-content-value`, optionClassName),
82
85
  style: {
83
86
  ...(mergedSearchValue ? {
@@ -88,8 +91,7 @@ const SingleContent = /*#__PURE__*/React.forwardRef(({
88
91
  title: optionTitle
89
92
  }, displayValue.label) : displayValue.label : /*#__PURE__*/React.createElement(_Placeholder.default, {
90
93
  show: !mergedSearchValue
91
- });
92
-
94
+ }) : null;
93
95
  // Render
94
96
  return /*#__PURE__*/React.createElement("div", {
95
97
  className: (0, _clsx.clsx)(`${prefixCls}-content`, showHasValueCls && `${prefixCls}-content-has-value`, mergedSearchValue && `${prefixCls}-content-has-search-value`, hasOptionStyle && `${prefixCls}-content-has-option-style`, classNames?.content),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rc-component/select",
3
- "version": "1.6.11",
3
+ "version": "1.6.12",
4
4
  "description": "React Select",
5
5
  "engines": {
6
6
  "node": ">=8.x"