x-ui-design 1.0.39 → 1.0.42

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/dist/index.esm.js CHANGED
@@ -4329,6 +4329,7 @@ const Select = ({
4329
4329
  const checkModeInitialValue = useMemo(() => (!Array.isArray(initialValue) ? [initialValue] : initialValue).filter(e => e !== undefined && e !== ''), [initialValue]);
4330
4330
  const [isHover, setIsHover] = useState(false);
4331
4331
  const selectRef = useRef(null);
4332
+ const selectInputRef = useRef(null);
4332
4333
  const [searchInputWidth, setSearchInputWidth] = useState(0);
4333
4334
  const [isOpen, setIsOpen] = useState(defaultOpen);
4334
4335
  const [searchFocused, setSearchFocused] = useState(false);
@@ -4432,6 +4433,9 @@ const Select = ({
4432
4433
  } else {
4433
4434
  if (showSearch) {
4434
4435
  setSearchFocused(true);
4436
+ if (selectInputRef.current) {
4437
+ selectInputRef.current.focus();
4438
+ }
4435
4439
  searchInputRef.current?.focus();
4436
4440
  }
4437
4441
  }
@@ -4567,7 +4571,7 @@ const Select = ({
4567
4571
  }
4568
4572
  }
4569
4573
  clearTimeout(timeout);
4570
- });
4574
+ }, 20);
4571
4575
  };
4572
4576
  const ArrowContainer = useMemo(() => {
4573
4577
  if (!showArrow) {
@@ -4742,7 +4746,12 @@ const Select = ({
4742
4746
  }
4743
4747
  }, searchFocused ? '' : placeholder)) : null, isOpen ? /*#__PURE__*/React.createElement("div", {
4744
4748
  className: `${prefixCls}-tag ${prefixClsV3}-tag contentEditable`
4745
- }, /*#__PURE__*/React.createElement("div", _extends({
4749
+ }, /*#__PURE__*/React.createElement("input", {
4750
+ ref: selectInputRef,
4751
+ style: {
4752
+ display: 'none'
4753
+ }
4754
+ }), /*#__PURE__*/React.createElement("div", _extends({
4746
4755
  ref: searchInputRef,
4747
4756
  onClick: e => {
4748
4757
  if (disabled) {