diff --git a/src/plugins/data/public/ui/query_editor/_query_editor.scss b/src/plugins/data/public/ui/query_editor/_query_editor.scss index 85076e8c0b23..897e9197da7c 100644 --- a/src/plugins/data/public/ui/query_editor/_query_editor.scss +++ b/src/plugins/data/public/ui/query_editor/_query_editor.scss @@ -153,10 +153,7 @@ .osdQueryEditor__header { display: flex; align-items: center; - - .osdQueryEditorExtensionComponent { - padding: 0 $euiSizeXS $euiSizeXS; - } + padding: 0 $euiSizeXS $euiSizeXS; } .osdQueryEditor__topBar { diff --git a/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extensions.tsx b/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extensions.tsx index 89e9f5e3c94f..e3de25ac5198 100644 --- a/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extensions.tsx +++ b/src/plugins/data/public/ui/query_editor/query_editor_extensions/query_editor_extensions.tsx @@ -27,16 +27,22 @@ const QueryEditorExtensions: React.FC = React.memo(( return ( <> {sortedConfigs.map((config) => { - const extensionComponentContainer = document.createElement('div'); - extensionComponentContainer.className = `osdQueryEditorExtensionComponent osdQueryEditorExtensionComponent__${config.id}`; - componentContainer.appendChild(extensionComponentContainer); + const id = `osdQueryEditorExtensionComponent-${config.id}`; + + let container = document.getElementById(id); + if (!container) { + container = document.createElement('div'); + container.className = `osdQueryEditorExtensionComponent osdQueryEditorExtensionComponent__${config.id}`; + container.id = id; + componentContainer.appendChild(container); + } return ( );