Skip to content

Commit 73b08ac

Browse files
authored
fix: Note/MarkdownNote node color change not reactive in vueNodes mode (#7294)
## Summary Move color/bgcolor initialization from class field overrides to constructor to preserve LGraphNodeProperties getter/setter instrumentation. Class field overrides were replacing the reactive property descriptors set by the parent constructor, preventing change events from firing. issue found while tesing in #3449 ## Screenshots Before https://github.com/user-attachments/assets/04499a3a-15c2-44fd-9819-6dd5f6849f20 After https://github.com/user-attachments/assets/ba93278b-9761-4d45-abb3-2a57ff95a900 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7294-fix-Note-MarkdownNote-node-color-change-not-reactive-in-vueNodes-mode-2c46d73d3650818f8ee6f6f0c0e61d39) by [Unito](https://www.unito.io)
1 parent c524ce3 commit 73b08ac

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/extensions/core/noteNode.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ app.registerExtension({
1414
static collapsable: boolean
1515
static title_mode: number
1616

17-
override color = LGraphCanvas.node_colors.yellow.color
18-
override bgcolor = LGraphCanvas.node_colors.yellow.bgcolor
1917
groupcolor = LGraphCanvas.node_colors.yellow.groupcolor
2018
override isVirtualNode: boolean
2119

2220
constructor(title: string) {
2321
super(title)
22+
23+
this.color = LGraphCanvas.node_colors.yellow.color
24+
this.bgcolor = LGraphCanvas.node_colors.yellow.bgcolor
25+
2426
if (!this.properties) {
2527
this.properties = { text: '' }
2628
}
@@ -53,12 +55,14 @@ app.registerExtension({
5355
class MarkdownNoteNode extends LGraphNode {
5456
static override title = 'Markdown Note'
5557

56-
override color = LGraphCanvas.node_colors.yellow.color
57-
override bgcolor = LGraphCanvas.node_colors.yellow.bgcolor
5858
groupcolor = LGraphCanvas.node_colors.yellow.groupcolor
5959

6060
constructor(title: string) {
6161
super(title)
62+
63+
this.color = LGraphCanvas.node_colors.yellow.color
64+
this.bgcolor = LGraphCanvas.node_colors.yellow.bgcolor
65+
6266
if (!this.properties) {
6367
this.properties = { text: '' }
6468
}

0 commit comments

Comments
 (0)