From ee1db240d7e772e1204d216d1b9b29c8351d774a Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Thu, 10 Jul 2025 08:28:23 -0600 Subject: [PATCH] Handle window resizes in config editor (#19070) --- web/src/pages/ConfigEditor.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/src/pages/ConfigEditor.tsx b/web/src/pages/ConfigEditor.tsx index d13f53476..b8c11d028 100644 --- a/web/src/pages/ConfigEditor.tsx +++ b/web/src/pages/ConfigEditor.tsx @@ -16,6 +16,7 @@ import { MdOutlineRestartAlt } from "react-icons/md"; import RestartDialog from "@/components/overlay/dialog/RestartDialog"; import { useTranslation } from "react-i18next"; import { useRestart } from "@/api/ws"; +import { useResizeObserver } from "@/hooks/resize-observer"; type SaveOptions = "saveonly" | "restart"; @@ -209,6 +210,10 @@ function ConfigEditor() { }; }, [hasChanges, t]); + // layout change handler + + const [{ width, height }] = useResizeObserver(configRef); + useEffect(() => { if (editorRef.current) { // Small delay to ensure DOM has updated @@ -218,7 +223,7 @@ function ConfigEditor() { return () => clearTimeout(timeoutId); } - }, [error]); + }, [error, width, height]); if (!config) { return ;