fis-component 0.0.89 → 0.0.90

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/esm/index.js CHANGED
@@ -73688,13 +73688,15 @@ const FISSelect = forwardRef(({ className, style, size = "md", options, value, d
73688
73688
  else {
73689
73689
  if (values.length > 0) {
73690
73690
  onChange(values[0]);
73691
- setIsOpen(false);
73691
+ // Delay closing to ensure react-hook-form processes the change first
73692
+ setTimeout(() => setIsOpen(false), 0);
73692
73693
  }
73693
73694
  }
73694
73695
  }, [multi, onChange]);
73695
73696
  const handleMenuClick = useCallback(() => {
73696
73697
  if (!multi) {
73697
- setIsOpen(false);
73698
+ // Delay closing to ensure react-hook-form processes the change first
73699
+ setTimeout(() => setIsOpen(false), 0);
73698
73700
  }
73699
73701
  }, [multi]);
73700
73702
  const menuProps = useMemo$1(() => ({
@@ -73745,7 +73747,11 @@ const FISSelect = forwardRef(({ className, style, size = "md", options, value, d
73745
73747
  document.addEventListener("mousedown", handleClickOutside);
73746
73748
  return () => document.removeEventListener("mousedown", handleClickOutside);
73747
73749
  }, [isOpen, referenceElement, popperElement]);
73748
- return (jsxs(DivWrapperSC$1, { className: className, style: style, children: [(textLabel || iconLabel) && (jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsx(DivInputWrapperSC, { ref: setReferenceElement, onClick: handleToggle, "$hasValue": !!value, children: jsx(FISSelectItem, { ...restProps, ref: ref, size: size, placeholder: placeholder, iconSuffix: isOpen ? jsx(ArrowUpIcon, {}) : jsx(ArrowDownIcon, {}), value: computedDisplayValue, disabled: disabled, activeDropdown: isOpen, negative: negative }) }), message && (jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && Array.isArray(value) && value.length > 0 && (jsx(SelectedTagsWrapper, { children: jsx(MultipleValue, { options: selectedItems, onRemove: handleOptionRemove }) })), isOpen && (jsx(Portal, { portal: portal, children: jsx(DivDropdownMenuSC, { ref: setPopperElement, style: {
73750
+ return (jsxs(DivWrapperSC$1, { className: className, style: style, children: [(textLabel || iconLabel) && (jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxs(DivInputWrapperSC, { ref: setReferenceElement, onClick: handleToggle, "$hasValue": !!value, children: [jsx("input", { ...restProps, ref: ref, type: "hidden", value: multi
73751
+ ? Array.isArray(value)
73752
+ ? value.join(",")
73753
+ : ""
73754
+ : (value ?? "") }), jsx(FISSelectItem, { size: size, placeholder: placeholder, iconSuffix: isOpen ? jsx(ArrowUpIcon, {}) : jsx(ArrowDownIcon, {}), value: computedDisplayValue, disabled: disabled, activeDropdown: isOpen, negative: negative, readOnly: true })] }), message && (jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && Array.isArray(value) && value.length > 0 && (jsx(SelectedTagsWrapper, { children: jsx(MultipleValue, { options: selectedItems, onRemove: handleOptionRemove }) })), isOpen && (jsx(Portal, { portal: portal, children: jsx(DivDropdownMenuSC, { ref: setPopperElement, style: {
73749
73755
  ...styles.popper,
73750
73756
  width: referenceElement?.offsetWidth,
73751
73757
  zIndex: 9999,