Skip to content

Cancel Connection

A connection in progress can always be abandoned - Escape while dragging, or a click on empty canvas when connecting by clicks - and OnConnectEnd tells every way a gesture can end apart: connected, refused by a handle and why, dropped on empty space, or cancelled.

Start dragging, then press Esc
Target
bit Blow

Try it

  • Drag from the handle under the top node and, before letting go, press Escape: the line disappears and the log says the gesture was cancelled.
  • Drag again and release on empty canvas: dropped, nothing connected. Release on the top handle of "Target" to connect.
  • Release on Target's bottom handle, or drag the same connection a second time: a handle refuses it, and the log shows the reason the canvas announces to screen readers.
  • Tick Click to connect, click a handle and move the pointer: the line follows it. Click another handle to connect, or click empty canvas or press Escape to cancel. Clear log empties the list.

How it works

  • OnConnectStart raises a BlowConnectionStartInfo - NodeId, HandleId, HandleType - when a connection starts.
  • OnConnectEnd is raised exactly once for every start, however the gesture ends, with a BlowConnectEndInfo. This page sorts the endings by its flags: IsValid (it connected), then Rejection (a handle refused it, and why), then IsDropped (released after a real drag on empty space); what is left was cancelled.
  • Escape cancels whatever gesture is running before it would clear the selection, so a connection being dragged ends with IsDropped false and nothing connected.
  • ConnectOnClick (off by default) makes connections by clicking one handle and then another; a click on empty canvas or Escape cancels the pending one.
  • The reason text comes from BlowAriaLabels.Default.ConnectionRejected(rejection), the sentence the canvas announces to screen readers when a drop is refused; set the canvas's AriaLabels to reword or translate it.
An unhandled error has occurred. Reload 🗙