react-better-html 1.1.224 → 1.1.225
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 +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3734,7 +3734,7 @@ var DropdownComponent = (0, import_react18.forwardRef)(function Dropdown({
|
|
|
3734
3734
|
if (!withDebounce) return;
|
|
3735
3735
|
onChangeSearch?.(debouncedSearchQuery);
|
|
3736
3736
|
}, [withDebounce, onChangeSearch, debouncedSearchQuery]);
|
|
3737
|
-
const displayValue = (withSearch && isFocused
|
|
3737
|
+
const displayValue = (withSearch && isFocused ? searchQuery : !Array.isArray(selectedOption) ? selectedOption?.label : void 0) ?? "";
|
|
3738
3738
|
const withClearButton = isOpen && (Array.isArray(selectedOption) ? selectedOption.length > 0 : selectedOption);
|
|
3739
3739
|
const readyPlaceholder = placeholder ?? `Select ${!withMultiselect ? "an " : ""}${label?.toLowerCase() ?? (0, import_react_better_core17.getPluralWord)("option", withMultiselect ? 2 : 1)}`;
|
|
3740
3740
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Div_default.column, { width: "100%", position: "relative", userSelect: "none", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
@@ -3755,7 +3755,7 @@ var DropdownComponent = (0, import_react18.forwardRef)(function Dropdown({
|
|
|
3755
3755
|
leftIcon,
|
|
3756
3756
|
autoComplete: "off",
|
|
3757
3757
|
className: `react-better-html-dropdown${Array.isArray(selectedOption) && selectedOption.length > 0 ? " react-better-html-dropdown-multiselect" : ""}${isOpen ? " react-better-html-dropdown-open" : ""}${isOpenLate ? " react-better-html-dropdown-open-late" : ""}${inputFieldClassName ? ` ${inputFieldClassName}` : ""}`,
|
|
3758
|
-
onClick: !disabled ? setIsOpen.toggle : void 0,
|
|
3758
|
+
onClick: !disabled ? withMultiselect ? setIsOpen.setTrue : setIsOpen.toggle : void 0,
|
|
3759
3759
|
onFocus: setIsFocused.setTrue,
|
|
3760
3760
|
onBlur: setIsFocused.setFalse,
|
|
3761
3761
|
onKeyDown: onKeyDownInputField,
|