react-better-html 1.1.78 → 1.1.79

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
@@ -4750,7 +4750,7 @@ var DropdownComponent = (0, import_react16.forwardRef)(function Dropdown({
4750
4750
  ...props
4751
4751
  }, ref) {
4752
4752
  const theme2 = useTheme();
4753
- const dropdownHolderRef = (0, import_react16.useRef)(null);
4753
+ const inputFieldHolderRef = (0, import_react16.useRef)(null);
4754
4754
  const inputRef = (0, import_react16.useRef)(null);
4755
4755
  const [isOpen, setIsOpen] = useBooleanState();
4756
4756
  const [isOpenLate, setIsOpenLate] = useBooleanState();
@@ -4861,7 +4861,7 @@ var DropdownComponent = (0, import_react16.forwardRef)(function Dropdown({
4861
4861
  }, [filteredOptions]);
4862
4862
  (0, import_react16.useEffect)(() => {
4863
4863
  const handleClickOutside = (event) => {
4864
- if (dropdownHolderRef.current && !dropdownHolderRef.current.contains(event.target)) {
4864
+ if (inputFieldHolderRef.current && !inputFieldHolderRef.current.contains(event.target)) {
4865
4865
  setIsOpen.setFalse();
4866
4866
  setSearchQuery("");
4867
4867
  setFocusedOptionIndex(void 0);
@@ -4881,7 +4881,7 @@ var DropdownComponent = (0, import_react16.forwardRef)(function Dropdown({
4881
4881
  const displayValue = withSearch && isFocused ? searchQuery : selectedOption?.label ?? "";
4882
4882
  const withClearButton = isOpen && selectedOption;
4883
4883
  const readyPlaceholder = placeholder ? placeholder : `Select an ${label?.toLowerCase() ?? "option"}`;
4884
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Div_default.column, { width: "100%", position: "relative", userSelect: "none", ...props, ref: dropdownHolderRef, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Div_default.row, { position: "relative", width: "100%", children: [
4884
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Div_default.column, { width: "100%", position: "relative", userSelect: "none", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Div_default.row, { position: "relative", width: "100%", children: [
4885
4885
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4886
4886
  InputField_default,
4887
4887
  {
@@ -4901,6 +4901,7 @@ var DropdownComponent = (0, import_react16.forwardRef)(function Dropdown({
4901
4901
  onFocus: setIsFocused.setTrue,
4902
4902
  onBlur: setIsFocused.setFalse,
4903
4903
  onKeyDown: onKeyDownInputField,
4904
+ holderRef: inputFieldHolderRef,
4904
4905
  onChangeValue: withSearch ? onChangeValue : void 0,
4905
4906
  insideInputFieldComponent: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4906
4907
  Div_default,
@@ -5360,9 +5361,9 @@ var InputFieldComponent = (0, import_react18.forwardRef)(function InputField({
5360
5361
  if (!withDebounce) return;
5361
5362
  onChangeValue?.(debouncedValue);
5362
5363
  }, [withDebounce, onChangeValue, debouncedValue]);
5363
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Div_default.column, { width: "100%", gap: theme2.styles.gap, ...styledComponentStylesWithExcluded, ref: holderRef, children: [
5364
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Div_default.column, { width: "100%", gap: theme2.styles.gap, ...styledComponentStylesWithExcluded, children: [
5364
5365
  label && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Label_default, { text: label, color: labelColor, required, isError: !!errorText }),
5365
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Div_default, { position: "relative", width: "100%", children: [
5366
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Div_default, { position: "relative", width: "100%", ref: holderRef, children: [
5366
5367
  leftIcon && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
5367
5368
  Icon_default,
5368
5369
  {