From 42a6efd4ed5f568b0531185c9c5211557fd31b36 Mon Sep 17 00:00:00 2001 From: Kawika Avilla Date: Sun, 25 Aug 2024 12:04:30 +0000 Subject: [PATCH] submit on update Signed-off-by: Kawika Avilla --- src/plugins/data/public/ui/query_editor/query_editor.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/data/public/ui/query_editor/query_editor.tsx b/src/plugins/data/public/ui/query_editor/query_editor.tsx index f4030e72aa80..82befefac001 100644 --- a/src/plugins/data/public/ui/query_editor/query_editor.tsx +++ b/src/plugins/data/public/ui/query_editor/query_editor.tsx @@ -232,9 +232,11 @@ export default class QueryEditorUI extends Component { if (!isEqual(this.props.query.dataset, prevQuery.dataset)) { if (this.inputRef) { - const newQueryString = this.queryString.getInitialQuery().query; + const newQuery = this.queryString.getInitialQuery(); + const newQueryString = newQuery.query; if (this.inputRef.getValue() !== newQueryString) { this.inputRef.setValue(newQueryString); + this.onSubmit(newQuery); } } }