x-ui-design 0.5.21 → 0.5.22

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
@@ -3329,7 +3329,7 @@ const SelectComponent = /*#__PURE__*/forwardRef(({
3329
3329
  const handleClickOutside = event => {
3330
3330
  if (!selectRef.current) return;
3331
3331
  const dropdown = document.querySelector(`.${prefixCls}-dropdown`);
3332
- const clickedInside = selectRef.current.contains(event.target) || dropdown && dropdown.contains(event.target);
3332
+ const clickedInside = selectRef.current.contains(event?.target) || dropdown && dropdown.contains(event?.target);
3333
3333
  if (!clickedInside) {
3334
3334
  setIsOpen(false);
3335
3335
  handleClearInputValue();
@@ -3476,12 +3476,7 @@ const SelectComponent = /*#__PURE__*/forwardRef(({
3476
3476
  onClear?.();
3477
3477
  handleClearInputValue();
3478
3478
  };
3479
- const handleRemoveTag = e => {
3480
- const updatedSelected = hasMode ? selected.filter(item => item !== e.target.value) : e.target.value;
3481
- onChange?.(updatedSelected);
3482
- onSelect?.(updatedSelected);
3483
- setSelected(updatedSelected);
3484
- };
3479
+ const handleRemoveTag = e => handleSelect(e, e.target.value);
3485
3480
  const handleOnKeyDown = e => {
3486
3481
  if (!isOpen) {
3487
3482
  return;
@@ -3566,7 +3561,9 @@ const SelectComponent = /*#__PURE__*/forwardRef(({
3566
3561
  const handleTriggerClick = () => {
3567
3562
  if (!disabled) {
3568
3563
  setIsOpen(!isOpen);
3569
- onDropdownVisibleChange?.(!isOpen, selected);
3564
+ if (isOpen) {
3565
+ onDropdownVisibleChange?.(!isOpen, selected);
3566
+ }
3570
3567
  }
3571
3568
  const searchContent = selectRef.current?.getElementsByClassName(`${prefixCls}-tag-container`)?.[0];
3572
3569
  if (searchContent) {