@db-ux/react-core-components 3.0.7 → 3.0.8-empty-custom-select-315e030

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.
@@ -499,12 +499,20 @@ function DBCustomSelectFn(props, component) {
499
499
  setSearchEnabled((_a = props.showSearch) !== null && _a !== void 0 ? _a : amountOptions > 9);
500
500
  }, [props.showSearch, amountOptions]);
501
501
  useEffect(() => {
502
- var _a;
502
+ var _a, _b;
503
503
  if (props.values &&
504
504
  Array.isArray(props.values) &&
505
505
  props.values !== _values) {
506
506
  set_values((_a = props.values) !== null && _a !== void 0 ? _a : []);
507
507
  }
508
+ else if (props.values === null ||
509
+ props.values === undefined ||
510
+ (Array.isArray(props.values) && ((_b = props.values) === null || _b === void 0 ? void 0 : _b.length) === 0)) {
511
+ // Handle the case where props.values is empty/null/undefined
512
+ // but state._values may still contain items that need to be cleared
513
+ // This fixes issues with form validation libraries that reset values
514
+ set_values([]);
515
+ }
508
516
  }, [props.values]);
509
517
  useEffect(() => {
510
518
  if (selectRef.current) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@db-ux/react-core-components",
3
- "version": "3.0.7",
3
+ "version": "3.0.8-empty-custom-select-315e030",
4
4
  "description": "React components for @db-ux/core-components",
5
5
  "repository": {
6
6
  "type": "git",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "sideEffects": false,
40
40
  "dependencies": {
41
- "@db-ux/core-components": "3.0.7",
42
- "@db-ux/core-foundations": "3.0.7"
41
+ "@db-ux/core-components": "3.0.8-empty-custom-select-315e030",
42
+ "@db-ux/core-foundations": "3.0.8-empty-custom-select-315e030"
43
43
  }
44
44
  }