Skip to content

Commit 70355a9

Browse files
committed
Conditionally render property description
1 parent 8968290 commit 70355a9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/packages/core/property/property-layout/property-layout.element.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ export class UmbPropertyLayoutElement extends UmbLitElement {
6060
public invalid?: boolean;
6161

6262
override render() {
63-
const ufmValue = { alias: this.alias, label: this.label, description: this.description };
6463
// TODO: Only show alias on label if user has access to DocumentType within settings:
6564
return html`
6665
<div id="headerColumn">
@@ -69,9 +68,7 @@ export class UmbPropertyLayoutElement extends UmbLitElement {
6968
${when(this.invalid, () => html`<uui-badge color="danger" attention>!</uui-badge>`)}
7069
</uui-label>
7170
<slot name="action-menu"></slot>
72-
<uui-scroll-container id="description">
73-
<umb-ufm-render .markdown=${this.description} .value=${ufmValue}></umb-ufm-render>
74-
</uui-scroll-container>
71+
${this.#renderDescription()}
7572
<slot name="description"></slot>
7673
</div>
7774
<div id="editorColumn">
@@ -82,6 +79,12 @@ export class UmbPropertyLayoutElement extends UmbLitElement {
8279
`;
8380
}
8481

82+
#renderDescription() {
83+
if (!this.description) return;
84+
const ufmValue = { alias: this.alias, label: this.label, description: this.description };
85+
return html`<umb-ufm-render .markdown=${this.description} .value=${ufmValue}></umb-ufm-render>`;
86+
}
87+
8588
static override styles = [
8689
UmbTextStyles,
8790
css`

0 commit comments

Comments
 (0)