Drag and drop strategy
dndStrategy selects which drag-and-drop implementation drives Dockview. The default ('auto') covers desktop and touch with no further configuration.
| Value | Behaviour |
|---|---|
'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.
| Gesture | Result |
|---|---|
| Tap | click fires normally; no drag |
| Quick horizontal swipe across the tab strip | Browser scrolls natively |
| Hold ~250 ms, then move | Drag arms; ghost follows the finger |
| Hold ~500 ms still | Context menu opens; any in-flight drag arm is cancelled |
| Release without movement | Nothing |
See also
- Drag and drop: the drag events and hooks the backend drives.
- External drag and drop events: narrowing
nativeEventacross the two backends. - Disable drag and drop:
disableDndoverrides every strategy.