@megha-ui/react 1.3.4 → 1.3.5
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.
|
@@ -77,14 +77,16 @@ const Dropdown = ({ options, selectedValues, onChange, placeholder = "Select..."
|
|
|
77
77
|
var _a, _b, _c, _d, _e;
|
|
78
78
|
if (isOpen && searchEnabled) {
|
|
79
79
|
(_a = searchInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
80
|
+
if (typeof maxDropdownHeight === "undefined") {
|
|
81
|
+
const rect = (_b = wrapperRef.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
|
|
82
|
+
const searchOptionRect = (_c = searchOptionRef.current) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect();
|
|
83
|
+
const viewportSpace = document.body.clientHeight -
|
|
84
|
+
((_d = rect === null || rect === void 0 ? void 0 : rect.bottom) !== null && _d !== void 0 ? _d : 0) -
|
|
85
|
+
8 -
|
|
86
|
+
((_e = searchOptionRect === null || searchOptionRect === void 0 ? void 0 : searchOptionRect.height) !== null && _e !== void 0 ? _e : 0);
|
|
87
|
+
const overflowSpace = getOverflowParentHeight(wrapperRef.current, viewportSpace);
|
|
88
|
+
setHeight(overflowSpace);
|
|
89
|
+
}
|
|
88
90
|
}
|
|
89
91
|
if (isOpen) {
|
|
90
92
|
setHighlightIndex(0);
|
package/package.json
CHANGED