@xqmsg/ui-core 0.16.7 → 0.16.8

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.
@@ -1029,10 +1029,6 @@ var StackedMultiSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2,
1029
1029
  debouncedSearchValue = _useState9[0],
1030
1030
  setDebouncedSearchValue = _useState9[1];
1031
1031
 
1032
- console.log({
1033
- searchValue: searchValue,
1034
- debouncedSearchValue: debouncedSearchValue
1035
- });
1036
1032
  var boundingClientRect = (_dropdownRef$current = dropdownRef.current) == null ? void 0 : _dropdownRef$current.getBoundingClientRect();
1037
1033
  React.useEffect(function () {
1038
1034
  if (window.innerHeight - ((boundingClientRect == null ? void 0 : boundingClientRect.y) + 240) >= 0) {
@@ -1046,12 +1042,12 @@ var StackedMultiSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2,
1046
1042
  }); // gets latest watched form value (common delimited) from RHF state and creates a list
1047
1043
 
1048
1044
  React.useEffect(function () {
1049
- if (watchedValue !== undefined && !watchedValue.length) {
1045
+ if (watchedValue !== undefined && !watchedValue.length && !isInit) {
1050
1046
  setLocalValues([]);
1051
1047
  setIsInit(true);
1052
1048
  }
1053
1049
 
1054
- if (watchedValue !== undefined && watchedValue != null && watchedValue.length) {
1050
+ if (watchedValue !== undefined && watchedValue != null && watchedValue.length && !isInit) {
1055
1051
  if (shouldSideScroll) {
1056
1052
  var _scrollRef$current;
1057
1053
 
@@ -1351,7 +1347,7 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
1351
1347
  }, [latestTokenElement, watchedValue]);
1352
1348
 
1353
1349
  var onHandleKeyDown = function onHandleKeyDown(e) {
1354
- if ((e.key === ' ' || e.key === 'Enter' || e.key === ',' || e.key === 'Tab') && localValue.length) {
1350
+ if (e.key === ' ' || e.key === 'Enter' || e.key === ',' || e.key === 'Tab') {
1355
1351
  if (e.key === 'Enter' && !localValue.trim().length && tokenIndex !== null) {
1356
1352
  setLocalValue(lastestFormValueToArray[tokenIndex]);
1357
1353
 
@@ -1455,7 +1451,10 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
1455
1451
 
1456
1452
  react.useOutsideClick({
1457
1453
  ref: inputWrapperRef,
1458
- handler: onBlur
1454
+ handler: function handler() {
1455
+ onBlur();
1456
+ console.log('hi');
1457
+ }
1459
1458
  });
1460
1459
  return /*#__PURE__*/React__default.createElement(react.Box, {
1461
1460
  position: "relative"
@@ -1468,6 +1467,10 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
1468
1467
  alignItems: "center",
1469
1468
  justifyContent: "space-between",
1470
1469
  onClick: function onClick() {
1470
+ if (isFocussed && tokenIndex !== null) {
1471
+ setTokenIndex(null);
1472
+ }
1473
+
1471
1474
  if (!disabled) {
1472
1475
  var _inputRef$current;
1473
1476
 
@@ -1502,7 +1505,7 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
1502
1505
  border: tokenIndex === index ? "1px solid " + colors.border.focus : 'none',
1503
1506
  borderRadius: "full",
1504
1507
  onClick: function onClick() {
1505
- return isFocussed && setTokenIndex(index);
1508
+ return setTokenIndex(index);
1506
1509
  },
1507
1510
  width: "100%",
1508
1511
  id: name + "_token_" + index
@@ -1541,7 +1544,8 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
1541
1544
  return setIsFocussed(true);
1542
1545
  },
1543
1546
  onBlur: function onBlur() {
1544
- return setIsFocussed(false);
1547
+ setIsFocussed(false);
1548
+ return setTokenIndex(null);
1545
1549
  }
1546
1550
  }))));
1547
1551
  });