Markdown Editor: adds "Default value" support (#18326)
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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 }) {
|
||||
|
||||
Reference in New Issue
Block a user