diff --git a/x-pack/plugins/lens/public/embeddable/embeddable.tsx b/x-pack/plugins/lens/public/embeddable/embeddable.tsx index ff1af09019c1b..0a4c47d82a601 100644 --- a/x-pack/plugins/lens/public/embeddable/embeddable.tsx +++ b/x-pack/plugins/lens/public/embeddable/embeddable.tsx @@ -1507,6 +1507,10 @@ export class Embeddable } public getIsEditable() { + // for ES|QL, editing is allowed only if the advanced setting is on + if (Boolean(this.isTextBasedLanguage()) && !this.deps.uiSettings.get('discover:enableESQL')) { + return false; + } return ( this.deps.capabilities.canSaveVisualizations || (!this.inputIsRefType(this.getInput()) &&