fix(nodes): use label content as inner html

This commit is contained in:
Braks
2022-04-24 13:34:22 +02:00
parent 4eb775477f
commit 14ef119a95
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ const DefaultNode: FunctionalComponent<NodeProps> = function ({
}) { }) {
return [ return [
h(Handle, { type: 'target', position: targetPosition, isConnectable: connectable, isValidConnection: isValidTargetPos }), h(Handle, { type: 'target', position: targetPosition, isConnectable: connectable, isValidConnection: isValidTargetPos }),
typeof label !== 'string' && label ? h(label) : h('span', {}, label), typeof label !== 'string' && label ? h(label) : h('div', { innerHTML: label }),
h(Handle, { type: 'source', position: sourcePosition, isConnectable: connectable, isValidConnection: isValidSourcePos }), h(Handle, { type: 'source', position: sourcePosition, isConnectable: connectable, isValidConnection: isValidSourcePos }),
] ]
} }
+1 -1
View File
@@ -9,7 +9,7 @@ const InputNode: FunctionalComponent<NodeProps> = function ({
isValidSourcePos, isValidSourcePos,
}) { }) {
return [ return [
typeof label !== 'string' && label ? h(label) : h('span', {}, label), typeof label !== 'string' && label ? h(label) : h('div', { innerHTML: label }),
h(Handle, { type: 'source', position: sourcePosition, isConnectable: connectable, isValidConnection: isValidSourcePos }), h(Handle, { type: 'source', position: sourcePosition, isConnectable: connectable, isValidConnection: isValidSourcePos }),
] ]
} }
+1 -1
View File
@@ -10,7 +10,7 @@ const OutputNode: FunctionalComponent<NodeProps> = function ({
}) { }) {
return [ return [
h(Handle, { type: 'target', position: targetPosition, isConnectable: connectable, isValidConnection: isValidTargetPos }), h(Handle, { type: 'target', position: targetPosition, isConnectable: connectable, isValidConnection: isValidTargetPos }),
typeof label !== 'string' && label ? h(label) : h('span', {}, label), typeof label !== 'string' && label ? h(label) : h('div', { innerHTML: label }),
] ]
} }