Markdown Editor: adds "Default value" support (#18326)

This commit is contained in:
Lee Kelleher
2025-02-17 16:01:41 +00:00
committed by GitHub
parent d87a84be14
commit e753e2cbf0
2 changed files with 7 additions and 1 deletions

View File

@@ -24,7 +24,7 @@ export const manifests: Array<UmbExtensionManifest> = [
alias: 'defaultValue',
label: 'Default value',
description: 'If value is blank, the editor will show this',
propertyEditorUiAlias: 'Umb.PropertyEditorUi.TextArea',
propertyEditorUiAlias: 'Umb.PropertyEditorUi.MarkdownEditor',
},
{
alias: 'overlaySize',

View File

@@ -39,6 +39,12 @@ export class UmbPropertyEditorUIMarkdownEditorElement extends UmbLitElement impl
this._preview = config.getValueByAlias('preview');
this._overlaySize = config.getValueByAlias('overlaySize') ?? 'small';
// TODO: To be removed once the "Property Value Presets" feature has been implemented.
const defaultValue = config.getValueByAlias<string>('defaultValue');
if (defaultValue && this.value === undefined) {
this.value = defaultValue;
}
}
#onChange(event: Event & { target: UmbInputMarkdownElement }) {