@tecsinapse/cortex-react 1.9.30 → 1.9.32
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.
|
@@ -27,6 +27,13 @@ const useFloatingElement = ({
|
|
|
27
27
|
fallbackPlacements
|
|
28
28
|
}),
|
|
29
29
|
react.shift(),
|
|
30
|
+
react.size({
|
|
31
|
+
apply({ rects, elements }) {
|
|
32
|
+
const minWidth = elements.floating.scrollWidth;
|
|
33
|
+
const referenceWidth = rects.reference.width;
|
|
34
|
+
elements.floating.style.width = `${Math.max(referenceWidth, minWidth)}px`;
|
|
35
|
+
}
|
|
36
|
+
}),
|
|
30
37
|
...arrowRef ? [react.arrow({ element: arrowRef })] : []
|
|
31
38
|
]
|
|
32
39
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useFloating, autoUpdate, offset, flip, shift, arrow, useClick, useDismiss, useRole, useHover, safePolygon, useInteractions } from '@floating-ui/react';
|
|
1
|
+
import { useFloating, autoUpdate, offset, flip, shift, size, arrow, useClick, useDismiss, useRole, useHover, safePolygon, useInteractions } from '@floating-ui/react';
|
|
2
2
|
import { useState, useEffect } from 'react';
|
|
3
3
|
|
|
4
4
|
const useFloatingElement = ({
|
|
@@ -25,6 +25,13 @@ const useFloatingElement = ({
|
|
|
25
25
|
fallbackPlacements
|
|
26
26
|
}),
|
|
27
27
|
shift(),
|
|
28
|
+
size({
|
|
29
|
+
apply({ rects, elements }) {
|
|
30
|
+
const minWidth = elements.floating.scrollWidth;
|
|
31
|
+
const referenceWidth = rects.reference.width;
|
|
32
|
+
elements.floating.style.width = `${Math.max(referenceWidth, minWidth)}px`;
|
|
33
|
+
}
|
|
34
|
+
}),
|
|
28
35
|
...arrowRef ? [arrow({ element: arrowRef })] : []
|
|
29
36
|
]
|
|
30
37
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tecsinapse/cortex-react",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.32",
|
|
4
4
|
"description": "React components based in @tecsinapse/cortex-core",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"react-dom": ">=18.0.0",
|
|
49
49
|
"tailwind": ">=3.3.0"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "273d9526ea0e880879473563dcf937221d4ce014"
|
|
52
52
|
}
|