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