@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.js CHANGED
@@ -2370,18 +2370,19 @@ function useCalendarState(props) {
2370
2370
  var CALENDAR_GAP = 4;
2371
2371
  var CALENDAR_MIN_WIDTH = 280;
2372
2372
  function useFloatingCalendarPosition(anchorRef, isOpen2, placement, align = "start") {
2373
- const [style, setStyle] = useState({ visibility: "hidden" });
2373
+ const [style, setStyle] = useState({ position: "fixed", visibility: "hidden" });
2374
2374
  useLayoutEffect(() => {
2375
2375
  if (!isOpen2 || !anchorRef.current) return;
2376
2376
  const update = () => {
2377
2377
  const rect = anchorRef.current.getBoundingClientRect();
2378
- const left = align === "end" ? Math.max(8, rect.right - CALENDAR_MIN_WIDTH) : rect.left;
2379
2378
  const base = {
2380
2379
  position: "fixed",
2381
- left,
2382
2380
  zIndex: CALENDAR_PORTAL_Z_INDEX,
2383
2381
  minWidth: CALENDAR_MIN_WIDTH,
2384
- visibility: "visible"
2382
+ visibility: "visible",
2383
+ ...align === "end" ? { left: rect.left } : { right: window.innerWidth - rect.right }
2384
+ // ? { right: window.innerWidth - rect.right }
2385
+ // : { left: rect.left }),
2385
2386
  };
2386
2387
  if (placement === "top") {
2387
2388
  setStyle({ ...base, bottom: window.innerHeight - rect.top + CALENDAR_GAP });