Skip to content

Commit cf9d95a

Browse files
authored
Fix PrimeVue ref error on adding node via searchbox (#298)
1 parent 7a980f4 commit cf9d95a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/components/NodeSearchBoxPopover.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ const closeDialog = () => {
6565
}
6666
6767
const addNode = (nodeDef: ComfyNodeDefImpl) => {
68-
closeDialog()
69-
7068
const node = app.addNodeOnGraph(nodeDef, { pos: getNewNodeLocation() })
7169
7270
const eventDetail = triggerEvent.value.detail
@@ -75,6 +73,13 @@ const addNode = (nodeDef: ComfyNodeDefImpl) => {
7573
ConnectingLinkImpl.createFromPlainObject(link).connectTo(node)
7674
})
7775
}
76+
77+
// TODO: This is not robust timing-wise.
78+
// PrimeVue complains about the dialog being closed before the event selecting
79+
// item is fully processed.
80+
window.setTimeout(() => {
81+
closeDialog()
82+
}, 100)
7883
}
7984
8085
const canvasEventHandler = (e: LiteGraphCanvasEvent) => {

0 commit comments

Comments
 (0)