File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
frontend/app/[locale]/chat/components Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export function ChatAgentSelector({
2323 left : 0 ,
2424 direction : "down" ,
2525 } ) ;
26+ const [ isPositionCalculated , setIsPositionCalculated ] = useState ( false ) ;
2627 const [ isAutoSelectInit , setIsAutoSelectInit ] = useState ( false ) ;
2728 const { t } = useTranslation ( "common" ) ;
2829 const buttonRef = useRef < HTMLDivElement > ( null ) ;
@@ -102,6 +103,9 @@ export function ChatAgentSelector({
102103 left : buttonRect . left ,
103104 direction,
104105 } ) ;
106+ setIsPositionCalculated ( true ) ;
107+ } else if ( ! isOpen ) {
108+ setIsPositionCalculated ( false ) ;
105109 }
106110 } , [ isOpen , isInitialMode ] ) ;
107111
@@ -241,6 +245,7 @@ export function ChatAgentSelector({
241245
242246 { /* Portal renders dropdown to body to avoid being blocked by parent container */ }
243247 { isOpen &&
248+ isPositionCalculated &&
244249 typeof window !== "undefined" &&
245250 createPortal (
246251 < >
You can’t perform that action at this time.
0 commit comments