Puppeteer: Drag Interception is not enabled!
A drag-data operation needs drag interception but it is disabled.
A drag-data operation needs drag interception but it is disabled.
Error message
Drag Interception is not enabled!
How this error happens
ElementHandle.dragAndDrop needs drag interception enabled on the page. It cannot request intercepted drag data when that feature is off.
The snippets use an open Puppeteer page named page.
await page.setContent(
'<div id="source" draggable="true">Item</div><div id="target">Drop here</div>'
);
const source = await page.$("#source");
const target = await page.$("#target");
await source.dragAndDrop(
target
);
How to fix
Enable drag interception before performing this drag-and-drop workflow.
await page.setDragInterception(
true
);
const source = await page.$("#source");
const target = await page.$("#target");
await source.dragAndDrop(
target
);
Things to keep in mind
This API is browser/protocol dependent. Applications using custom pointer-based dragging may need mouse movement rather than HTML drag interception.