File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
apps/frontend/src/components/commons/popover Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 1- import { useEffect , useRef , useState } from "react" ;
1+ import { useEffect , useLayoutEffect , useRef , useState } from "react" ;
22import { usePopover } from "@/hooks/usePopover" ;
33import { cn } from "@/lib/utils" ;
44import { getPosition } from "@/lib/getPopoverPosition" ;
@@ -13,7 +13,7 @@ export function Content({ children, className }: ContentProps) {
1313 const contentRef = useRef < HTMLDivElement > ( null ) ;
1414 const [ position , setPosition ] = useState ( { top : 0 , left : 0 } ) ;
1515
16- useEffect ( ( ) => {
16+ useLayoutEffect ( ( ) => {
1717 if ( open && triggerRef . current && contentRef . current ) {
1818 const triggerRect = triggerRef . current . getBoundingClientRect ( ) ;
1919 const contentRect = contentRef . current . getBoundingClientRect ( ) ;
You can’t perform that action at this time.
0 commit comments