bcakmakoglu/vue-flow

onConnect method in useHandleConnections still not work after update to version 1.34.1

ljw20180420 opened this issue · 2 comments

Is there an existing issue for this?

  • I have searched the existing issues and this is a new bug.

Current Behavior

onConnect method in useHandleConnections still not work after update to version 1.34.1

Expected Behavior

onConnect method in useHandleConnections should work after update to version 1.34.1

Steps To Reproduce

  1. git clone https://github.com/ljw20180420/vueFlowBug
  2. cd vueFlowBug
  3. npm install
  4. npm add @vue-flow/core
  5. npm run dev
  6. Connect the two nodes. There is no console.log display. So onConnect method of useHandleConnections still does not work.

Relevant log output

No response

Anything else?

No response

It works but the existing bug #1393 causes some issues due to auto-generated handle ids.

To solve this set ids on your handles and use the id in useHandleConnections
For example:

<Handle id="left" type="target" :position="Position.Left" />
const conns = useHandleConnections({
  type: 'target',
  id: 'left',
  onConnect(connections) {
    console.log('source connected', connections)
  },
})

Thank you.