envoc-form 3.0.0-2 → 3.0.0-3

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.
@@ -115,7 +115,7 @@ var Select = function Select(_ref3) {
115
115
  options = _ref3.options,
116
116
  props = _objectWithoutProperties(_ref3, _excluded3);
117
117
 
118
- var allOptions = includeEmptyOption ? [{
118
+ var allOptions = includeEmptyOption && !props.isMulti ? [{
119
119
  label: ' ',
120
120
  value: null
121
121
  }].concat(_toConsumableArray(options)) : options;
@@ -166,7 +166,7 @@ var RemoteSelect = function RemoteSelect(_ref4) {
166
166
  value: ''
167
167
  });
168
168
  } else {
169
- if (includeEmptyOption) {
169
+ if (includeEmptyOption && !props.isMulti) {
170
170
  options.push({
171
171
  label: ' ',
172
172
  value: null
@@ -140,7 +140,7 @@ var Select = function Select(_ref3) {
140
140
  includeEmptyOption = _ref3$includeEmptyOpt === void 0 ? true : _ref3$includeEmptyOpt,
141
141
  options = _ref3.options,
142
142
  props = (0, _objectWithoutProperties2["default"])(_ref3, _excluded3);
143
- var allOptions = includeEmptyOption ? [{
143
+ var allOptions = includeEmptyOption && !props.isMulti ? [{
144
144
  label: ' ',
145
145
  value: null
146
146
  }].concat((0, _toConsumableArray2["default"])(options)) : options;
@@ -191,7 +191,7 @@ var RemoteSelect = function RemoteSelect(_ref4) {
191
191
  value: ''
192
192
  });
193
193
  } else {
194
- if (includeEmptyOption) {
194
+ if (includeEmptyOption && !props.isMulti) {
195
195
  options.push({
196
196
  label: ' ',
197
197
  value: null
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "envoc-form",
3
- "version": "3.0.0-2",
3
+ "version": "3.0.0-3",
4
4
  "description": "Envoc form components",
5
5
  "keywords": [
6
6
  "react-component",
@@ -37,7 +37,7 @@
37
37
  "axios": "^0.21.1",
38
38
  "classnames": "^2.3.1",
39
39
  "date-fns": "^2.22.1",
40
- "envoc-request": "^3.0.0-2",
40
+ "envoc-request": "^3.0.0-3",
41
41
  "lru-cache": "^6.0.0",
42
42
  "prop-types": "^15.7.2",
43
43
  "react-date-picker": "^8.2.0",
@@ -81,9 +81,10 @@ const DefaultInput = ({ meta, ...props }) => {
81
81
  };
82
82
 
83
83
  const Select = ({ includeEmptyOption = true, options, ...props }) => {
84
- const allOptions = includeEmptyOption
85
- ? [{ label: ' ', value: null }, ...options]
86
- : options;
84
+ const allOptions =
85
+ includeEmptyOption && !props.isMulti
86
+ ? [{ label: ' ', value: null }, ...options]
87
+ : options;
87
88
  return <ReactSelectField {...props} options={allOptions} />;
88
89
  };
89
90
 
@@ -115,7 +116,7 @@ const RemoteSelect = ({
115
116
  if (webRequest.loading) {
116
117
  options.push({ label: 'Loading...', value: '' });
117
118
  } else {
118
- if (includeEmptyOption) {
119
+ if (includeEmptyOption && !props.isMulti) {
119
120
  options.push({ label: ' ', value: null });
120
121
  }
121
122
  options.push(...webRequest.resp.data.result);