Skip to main content

Drag and drop strategy

dndStrategy selects which drag-and-drop implementation drives Dockview. The default ('auto') covers desktop and touch with no further configuration.

ValueBehaviour
'auto' (default)HTML5 drives mouse drags; pointer events drive touch and pen drags.
'pointer'Pointer events drive every input type. Useful where HTML5 drag-and-drop is unreliable (some Linux browsers, certain Safari versions, embedded webviews). Cross-window HTML5 drag and the native browser drag image are not available in this mode.
'html5'HTML5 drag-and-drop only; touch and pen drags are disabled.

disableDnd: true overrides every strategy. The strategy can also be changed at runtime via api.updateOptions({ dndStrategy: ... }); the change propagates to every existing drag source.

Reading what 'auto' resolved to​

'auto' decides from the device, so the configured value does not tell you which backend is live. api.dndCapabilities reports the resolved answer:

const { html5, pointer, pointerHandlesMouse } = api.dndCapabilities;

It is read fresh each time, and follows updateOptions.

This matters most for drags that cross a window boundary. Only an HTML5 drag rides an OS drag session, so only an HTML5 drag can move a tab between a popout window and the main window. An embedded webview reporting a coarse pointer and no fine pointer resolves 'auto' to the pointer backend, where no host configuration will make that drag work. Check html5 rather than assuming it.

Touch gestures​

Under 'auto' and 'pointer', touch drags use a long-press-then-drag gesture so taps and native scroll still work.

GestureResult
Tapclick fires normally; no drag
Quick horizontal swipe across the tab stripBrowser scrolls natively
Hold ~250 ms, then moveDrag arms; ghost follows the finger
Hold ~500 ms stillContext menu opens; any in-flight drag arm is cancelled
Release without movementNothing

See also​