From 53af1f42ad56cecce7f3e9c5cc313a660045b636 Mon Sep 17 00:00:00 2001
From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
Date: Tue, 3 Jun 2025 15:16:37 -0500
Subject: [PATCH] Ensure config editor recalculates layout on error
---
web/src/pages/ConfigEditor.tsx | 28 ++++++++++++++++++++--------
1 file changed, 20 insertions(+), 8 deletions(-)
diff --git a/web/src/pages/ConfigEditor.tsx b/web/src/pages/ConfigEditor.tsx
index 01d76303d..8d828cee2 100644
--- a/web/src/pages/ConfigEditor.tsx
+++ b/web/src/pages/ConfigEditor.tsx
@@ -209,13 +209,24 @@ function ConfigEditor() {
};
}, [hasChanges, t]);
+ useEffect(() => {
+ if (editorRef.current) {
+ // Small delay to ensure DOM has updated
+ const timeoutId = setTimeout(() => {
+ editorRef.current?.layout();
+ }, 0);
+
+ return () => clearTimeout(timeoutId);
+ }
+ }, [error]);
+
if (!config) {
return