Skip to content

Commit 703de3e

Browse files
authored
Fix/vue nodes markdown (#5771)
## Summary Improve markdown node by making the textarea match the rendered output width and height. ## Screenshots (if applicable) https://github.com/user-attachments/assets/4701f947-0a4f-40f3-83c0-94e53cd10106 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5771-Fix-vue-nodes-markdown-2796d73d365081129428fe9c38178cc4) by [Unito](https://www.unito.io)
1 parent 415ebfd commit 703de3e

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/renderer/extensions/vueNodes/widgets/components/WidgetMarkdown.vue

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,21 @@
55
>
66
<!-- Display mode: Rendered markdown -->
77
<div
8-
v-if="!isEditing"
9-
class="comfy-markdown-content text-xs min-h-[60px] rounded-lg px-4 py-2 overflow-y-auto lod-toggle"
8+
class="comfy-markdown-content hover:bg-[var(--p-content-hover-background)] text-sm min-h-[60px] w-full rounded-lg px-4 py-2 overflow-y-auto lod-toggle"
9+
:class="isEditing === false ? 'visible' : 'invisible'"
1010
v-html="renderedHtml"
1111
/>
1212

1313
<!-- Edit mode: Textarea -->
1414
<Textarea
15-
v-else
15+
v-show="isEditing"
1616
ref="textareaRef"
1717
v-model="localValue"
1818
:disabled="readonly"
19-
class="w-full text-xs"
20-
size="small"
21-
:rows="6"
19+
class="w-full min-h-[60px] absolute inset-0 resize-none"
2220
:pt="{
2321
root: {
22+
class: 'text-sm w-full h-full',
2423
onBlur: handleBlur
2524
}
2625
}"
@@ -92,7 +91,7 @@ const handleBlur = () => {
9291
border-radius: var(--p-border-radius);
9392
}
9493
95-
.widget-markdown:hover:not(:has(textarea)) {
94+
.comfy-markdown-content:hover {
9695
background-color: var(--p-content-hover-background);
9796
}
9897
</style>

0 commit comments

Comments
 (0)