-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Closed
Copy link
Labels
Description
Pre-check
- I know I can edit the docs but prefer to file this issue
Describe the improvement
Unclear documentation
Description of the improvement / report
I read the documentation a few times, but missed that the target element must be awaited for dragAndDrop to work.
await $("#elementToDrag").dragAndDrop($("#dropTarget")); // fails
await $("#elementToDrag").dragAndDrop(await $("#dropTarget")); // works - but TypeScript says the await is not neededOn the other hand the documentation awaits $("#someElem") but that is not needed.
I suggest to write the example like this:
it('should demonstrate the dragAndDrop command', async () => {
const elem = $('#someElem')
const target = $('#someTarget')
// drag and drop to other element
await elem.dragAndDrop(await target); // target MUST be awaited!
// drag and drop relative from current position
await elem.dragAndDrop({ x: 100, y: 200 })
})Code of Conduct
- I agree to follow this project's Code of Conduct
Reactions are currently unavailable