From a7d9857a697a0d864b130aaf2dd0dcf8664bc46e Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 31 Mar 2021 22:32:28 +0200 Subject: [PATCH] web/elements: fix codemirror not being updateable without focus Signed-off-by: Jens Langhammer --- web/src/elements/CodeMirror.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/web/src/elements/CodeMirror.ts b/web/src/elements/CodeMirror.ts index 3c3db67a6..6d1c7381b 100644 --- a/web/src/elements/CodeMirror.ts +++ b/web/src/elements/CodeMirror.ts @@ -44,14 +44,10 @@ export class CodeMirrorTextarea extends LitElement { } private getInnerValue(): string { - if (!this.shadowRoot) { + if (!this.editor) { return ""; } - const ta = this.shadowRoot?.querySelector("textarea"); - if (!ta) { - return ""; - } - return ta.value; + return this.editor.getValue(); } static get styles(): CSSResult[] {