From 4000fea39d7df9971f229887ebb8d19cd21154a7 Mon Sep 17 00:00:00 2001 From: Anton Ulyanov Date: Thu, 16 Jan 2025 16:12:05 +0300 Subject: [PATCH] StatsHouse UI: fix promql editor empty value --- statshouse-ui/src/components/UI/PromQLEditor.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/statshouse-ui/src/components/UI/PromQLEditor.tsx b/statshouse-ui/src/components/UI/PromQLEditor.tsx index f9419d364..2247579f7 100644 --- a/statshouse-ui/src/components/UI/PromQLEditor.tsx +++ b/statshouse-ui/src/components/UI/PromQLEditor.tsx @@ -89,7 +89,7 @@ export function PromQLEditor({ value = '', onChange, className }: PromQLEditorPr }, [onChange]); useEffect(() => { - if (editor.current?.state.doc.toString() !== state.doc.toString()) { + if (editor.current?.state.doc.toString() !== state.doc.toString() || state.doc.toString() === '') { editor.current?.setState(state); } }, [state, value]);