From 94ec300d4c4b08e95d736e082cd1ae22021a9668 Mon Sep 17 00:00:00 2001 From: zhujiruo Date: Sat, 14 Jun 2025 18:42:15 +0800 Subject: [PATCH] fix(web): optimize Modal width adjustment logic for the log details panel (#20980) - Use requestAnimationFrame instead of directly calling adjustModalWidth to ensure successful retrieval of clientWidth --- web/app/components/app/log/list.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/app/components/app/log/list.tsx b/web/app/components/app/log/list.tsx index 3062e3a911..208fddecd1 100644 --- a/web/app/components/app/log/list.tsx +++ b/web/app/components/app/log/list.tsx @@ -354,7 +354,8 @@ function DetailPanel({ detail, onFeedback }: IDetailPanel) { } useEffect(() => { - adjustModalWidth() + const raf = requestAnimationFrame(adjustModalWidth) + return () => cancelAnimationFrame(raf) }, []) return (