Skip to content

Commit

Permalink
Fix PrimeVue ref error on adding node via searchbox
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei committed Aug 4, 2024
1 parent 7a980f4 commit 91dd204
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/NodeSearchBoxPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ const closeDialog = () => {
}
const addNode = (nodeDef: ComfyNodeDefImpl) => {
closeDialog()
const node = app.addNodeOnGraph(nodeDef, { pos: getNewNodeLocation() })
const eventDetail = triggerEvent.value.detail
Expand All @@ -75,6 +73,13 @@ const addNode = (nodeDef: ComfyNodeDefImpl) => {
ConnectingLinkImpl.createFromPlainObject(link).connectTo(node)
})
}
// TODO: This is not robust timing-wise.
// PrimeVue complains about the dialog being closed before the event selecting
// item is fully processed.
window.setTimeout(() => {
closeDialog()
}, 100)
}
const canvasEventHandler = (e: LiteGraphCanvasEvent) => {
Expand Down

0 comments on commit 91dd204

Please sign in to comment.