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/cjs/index.js CHANGED
@@ -73708,13 +73708,15 @@ const FISSelect = React.forwardRef(({ className, style, size = "md", options, va
73708
73708
  else {
73709
73709
  if (values.length > 0) {
73710
73710
  onChange(values[0]);
73711
- setIsOpen(false);
73711
+ // Delay closing to ensure react-hook-form processes the change first
73712
+ setTimeout(() => setIsOpen(false), 0);
73712
73713
  }
73713
73714
  }
73714
73715
  }, [multi, onChange]);
73715
73716
  const handleMenuClick = React.useCallback(() => {
73716
73717
  if (!multi) {
73717
- setIsOpen(false);
73718
+ // Delay closing to ensure react-hook-form processes the change first
73719
+ setTimeout(() => setIsOpen(false), 0);
73718
73720
  }
73719
73721
  }, [multi]);
73720
73722
  const menuProps = React.useMemo(() => ({
@@ -73765,7 +73767,11 @@ const FISSelect = React.forwardRef(({ className, style, size = "md", options, va
73765
73767
  document.addEventListener("mousedown", handleClickOutside);
73766
73768
  return () => document.removeEventListener("mousedown", handleClickOutside);
73767
73769
  }, [isOpen, referenceElement, popperElement]);
73768
- return (jsxRuntime.jsxs(DivWrapperSC$1, { className: className, style: style, children: [(textLabel || iconLabel) && (jsxRuntime.jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxRuntime.jsx(DivInputWrapperSC, { ref: setReferenceElement, onClick: handleToggle, "$hasValue": !!value, children: jsxRuntime.jsx(FISSelectItem, { ...restProps, ref: ref, size: size, placeholder: placeholder, iconSuffix: isOpen ? jsxRuntime.jsx(ArrowUpIcon, {}) : jsxRuntime.jsx(ArrowDownIcon, {}), value: computedDisplayValue, disabled: disabled, activeDropdown: isOpen, negative: negative }) }), message && (jsxRuntime.jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && Array.isArray(value) && value.length > 0 && (jsxRuntime.jsx(SelectedTagsWrapper, { children: jsxRuntime.jsx(MultipleValue, { options: selectedItems, onRemove: handleOptionRemove }) })), isOpen && (jsxRuntime.jsx(Portal, { portal: portal, children: jsxRuntime.jsx(DivDropdownMenuSC, { ref: setPopperElement, style: {
73770
+ return (jsxRuntime.jsxs(DivWrapperSC$1, { className: className, style: style, children: [(textLabel || iconLabel) && (jsxRuntime.jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsxRuntime.jsxs(DivInputWrapperSC, { ref: setReferenceElement, onClick: handleToggle, "$hasValue": !!value, children: [jsxRuntime.jsx("input", { ...restProps, ref: ref, type: "hidden", value: multi
73771
+ ? Array.isArray(value)
73772
+ ? value.join(",")
73773
+ : ""
73774
+ : (value ?? "") }), jsxRuntime.jsx(FISSelectItem, { size: size, placeholder: placeholder, iconSuffix: isOpen ? jsxRuntime.jsx(ArrowUpIcon, {}) : jsxRuntime.jsx(ArrowDownIcon, {}), value: computedDisplayValue, disabled: disabled, activeDropdown: isOpen, negative: negative, readOnly: true })] }), message && (jsxRuntime.jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && Array.isArray(value) && value.length > 0 && (jsxRuntime.jsx(SelectedTagsWrapper, { children: jsxRuntime.jsx(MultipleValue, { options: selectedItems, onRemove: handleOptionRemove }) })), isOpen && (jsxRuntime.jsx(Portal, { portal: portal, children: jsxRuntime.jsx(DivDropdownMenuSC, { ref: setPopperElement, style: {
73769
73775
  ...styles.popper,
73770
73776
  width: referenceElement?.offsetWidth,
73771
73777
  zIndex: 9999,