@aristobyte-ui/dropdown 2.15.1 → 2.15.3
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.
|
@@ -90,8 +90,9 @@ var Dropdown = function (_a) {
|
|
|
90
90
|
var boxRef = React.useRef(null);
|
|
91
91
|
var uniqueId = React.useId();
|
|
92
92
|
var computePosition = React.useCallback(function () {
|
|
93
|
-
if (!buttonContainerRef.current || !boxRef.current)
|
|
93
|
+
if (!buttonContainerRef.current || !boxRef.current) {
|
|
94
94
|
return;
|
|
95
|
+
}
|
|
95
96
|
var rect = buttonContainerRef.current.getBoundingClientRect();
|
|
96
97
|
var dropdownRect = boxRef.current.getBoundingClientRect();
|
|
97
98
|
var spaceBelow = window.innerHeight - rect.bottom;
|
|
@@ -131,15 +132,17 @@ var Dropdown = function (_a) {
|
|
|
131
132
|
}
|
|
132
133
|
};
|
|
133
134
|
var handleToggle = function (e) {
|
|
134
|
-
if (disabled)
|
|
135
|
+
if (disabled) {
|
|
135
136
|
return;
|
|
137
|
+
}
|
|
136
138
|
if (button === null || button === void 0 ? void 0 : button.onClick)
|
|
137
139
|
button.onClick(e);
|
|
138
140
|
setIsOpened(function (prev) { return !prev; });
|
|
139
141
|
};
|
|
140
142
|
React.useLayoutEffect(function () {
|
|
141
|
-
if (!isOpened)
|
|
143
|
+
if (!isOpened) {
|
|
142
144
|
return;
|
|
145
|
+
}
|
|
143
146
|
var raf = requestAnimationFrame(function () {
|
|
144
147
|
computePosition();
|
|
145
148
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aristobyte-ui/dropdown",
|
|
3
3
|
"description": "react dropdown component with trigger button, dropdownoptions, placement variants, fully typed typescript support, and composable integration with aristobyte ui button",
|
|
4
|
-
"version": "2.15.
|
|
4
|
+
"version": "2.15.3",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
7
7
|
"author": "AristoByte <info@aristobyte.com>",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"sass": "^1.97.3"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@aristobyte-ui/button": "^2.15.
|
|
56
|
-
"@aristobyte-ui/utils": "^2.15.
|
|
55
|
+
"@aristobyte-ui/button": "^2.15.3",
|
|
56
|
+
"@aristobyte-ui/utils": "^2.15.3"
|
|
57
57
|
},
|
|
58
58
|
"exports": {
|
|
59
59
|
".": {
|