feat: convert direct options update to attributes instead

This commit is contained in:
Jacob Overgaard
2024-07-22 15:14:46 +02:00
parent 423b57e80e
commit 74a8fcfba6

View File

@@ -50,12 +50,6 @@ export class UmbInputMarkdownElement extends UmbFormControlMixin(UmbLitElement,
try {
this.#editor = this._codeEditor?.editor;
this.#editor?.updateOptions({
lineNumbers: false,
minimap: false,
folding: false,
}); // Prefer to update options before showing the editor, to avoid seeing the changes in the UI.
// TODO: make all action into extensions
this.observe(umbExtensionsRegistry.byType('monacoMarkdownEditorAction'), (manifests) => {
manifests.forEach(async (manifest) => {
@@ -410,6 +404,9 @@ export class UmbInputMarkdownElement extends UmbFormControlMixin(UmbLitElement,
<umb-code-editor
language="markdown"
.code=${this.value as string}
disable-line-numbers
disable-minimap
disable-folding
@input=${this.#onInput}
@keypress=${this.#onKeyPress}
@loaded=${this.#onCodeEditorLoaded}>