@farmzone/fz-react-ui 1.0.23 → 1.1.0
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.cjs +5 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2404,18 +2404,19 @@ function useCalendarState(props) {
|
|
|
2404
2404
|
var CALENDAR_GAP = 4;
|
|
2405
2405
|
var CALENDAR_MIN_WIDTH = 280;
|
|
2406
2406
|
function useFloatingCalendarPosition(anchorRef, isOpen2, placement, align = "start") {
|
|
2407
|
-
const [style, setStyle] = React6.useState({ visibility: "hidden" });
|
|
2407
|
+
const [style, setStyle] = React6.useState({ position: "fixed", visibility: "hidden" });
|
|
2408
2408
|
React6.useLayoutEffect(() => {
|
|
2409
2409
|
if (!isOpen2 || !anchorRef.current) return;
|
|
2410
2410
|
const update = () => {
|
|
2411
2411
|
const rect = anchorRef.current.getBoundingClientRect();
|
|
2412
|
-
const left = align === "end" ? Math.max(8, rect.right - CALENDAR_MIN_WIDTH) : rect.left;
|
|
2413
2412
|
const base = {
|
|
2414
2413
|
position: "fixed",
|
|
2415
|
-
left,
|
|
2416
2414
|
zIndex: CALENDAR_PORTAL_Z_INDEX,
|
|
2417
2415
|
minWidth: CALENDAR_MIN_WIDTH,
|
|
2418
|
-
visibility: "visible"
|
|
2416
|
+
visibility: "visible",
|
|
2417
|
+
...align === "end" ? { left: rect.left } : { right: window.innerWidth - rect.right }
|
|
2418
|
+
// ? { right: window.innerWidth - rect.right }
|
|
2419
|
+
// : { left: rect.left }),
|
|
2419
2420
|
};
|
|
2420
2421
|
if (placement === "top") {
|
|
2421
2422
|
setStyle({ ...base, bottom: window.innerHeight - rect.top + CALENDAR_GAP });
|