sciter-sdk icon indicating copy to clipboard operation
sciter-sdk copied to clipboard

Misstype in acceptDrop function.

Open ValentiWorkLearning opened this issue 6 years ago • 1 comments

Look at this signature of acceptDrop: https://github.com/c-smile/sciter-sdk/blob/f750c7cb135ae3e580d97cfeaedce0010f3ff67b/samples/drag-n-drop-manager/ddm.tis#L21 And the call on ddm.tis: if(!def.acceptDrop || def.acceptDrop( dd_source, dd_target, dst.index )) Probably signature need to be changed to

//| def.acceptDrop = function(draggable, target, insertIndex), function to be called before the drop, if it is defined and returns true operation ends successfully.

ValentiWorkLearning avatar Oct 02 '19 09:10 ValentiWorkLearning

And, I'm not sure, that destination index needed for acceptDrop function. Probably when draggable arrives to target - it's possible to check the correctness of drop possibility without index. Moreover, index of destination is unuseful for tree-structures with drag-n-drop. I think, the better solution is remove the dst.index from def.acceptDrop signature.

ValentiWorkLearning avatar Oct 02 '19 15:10 ValentiWorkLearning