Skip to content

Commit 2ba98ef

Browse files
committed
fix(node-toolbar): set default value for isVisible to undefined (#1785)
* fix(node-toolbar): set default value for isVisible to undefined Signed-off-by: braks <[email protected]> * chore(changeset): add Signed-off-by: braks <[email protected]> --------- Signed-off-by: braks <[email protected]>
1 parent dd9c92f commit 2ba98ef

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.changeset/olive-fishes-fetch.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@vue-flow/node-toolbar": patch
3+
---
4+
5+
Set default value for `isVisible` to `undefined`

packages/node-toolbar/src/NodeToolbar.vue

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts" setup>
2-
import { computed, inject, toRef } from 'vue'
2+
import { computed, inject } from 'vue'
33
import type { GraphNode, Rect, ViewportTransform } from '@vue-flow/core'
44
import { NodeIdInjection, Position, getRectOfNodes, useVueFlow } from '@vue-flow/core'
55
@@ -10,6 +10,7 @@ const props = withDefaults(defineProps<NodeToolbarProps>(), {
1010
position: Position.Top,
1111
offset: 10,
1212
align: 'center',
13+
isVisible: undefined,
1314
})
1415
1516
const contextNodeId = inject(NodeIdInjection, null)
@@ -30,7 +31,7 @@ const nodes = computed(() => {
3031
}, [] as GraphNode[])
3132
})
3233
33-
const isActive = toRef(() =>
34+
const isActive = computed(() =>
3435
typeof props.isVisible === 'boolean'
3536
? props.isVisible
3637
: nodes.value.length === 1 && nodes.value[0].selected && getSelectedNodes.value.length === 1,

0 commit comments

Comments
 (0)