{"action":"created","issue":{"url":"https://api.github.com/repos/bevacqua/dragula/issues/187","labels_url":"https://api.github.com/repos/bevacqua/dragula/issues/187/labels{/name}","comments_url":"https://api.github.com/repos/bevacqua/dragula/issues/187/comments","events_url":"https://api.github.com/repos/bevacqua/dragula/issues/187/events","html_url":"https://github.com/bevacqua/dragula/issues/187","id":103939398,"number":187,"title":"Dropping also gives target element","user":{"login":"hnry","id":25837,"avatar_url":"https://avatars.githubusercontent.com/u/25837?v=3","gravatar_id":"","url":"https://api.github.com/users/hnry","html_url":"https://github.com/hnry","followers_url":"https://api.github.com/users/hnry/followers","following_url":"https://api.github.com/users/hnry/following{/other_user}","gists_url":"https://api.github.com/users/hnry/gists{/gist_id}","starred_url":"https://api.github.com/users/hnry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hnry/subscriptions","organizations_url":"https://api.github.com/users/hnry/orgs","repos_url":"https://api.github.com/users/hnry/repos","events_url":"https://api.github.com/users/hnry/events{/privacy}","received_events_url":"https://api.github.com/users/hnry/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bevacqua/dragula/labels/feature-request","name":"feature-request","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-08-30T18:32:53Z","updated_at":"2015-09-01T18:31:44Z","closed_at":null,"body":"Cool library, I would like to suggest a feature if I can.\r\n\r\nDropping an element onto a target container over a target container's element should report the target container's element too.\r\n\r\nA scenario which this is useful is having the ability to stack elements (like cards). So a user drags to add / remove elements, but can also stack elements on top of each other. (The stacking effect not provided by dragula, but the additional API change is needed). Or getting a count, dragging element onto target element, check if elements are the same, then 'stack' (update count)."},"comment":{"url":"https://api.github.com/repos/bevacqua/dragula/issues/comments/136821375","html_url":"https://github.com/bevacqua/dragula/issues/187#issuecomment-136821375","issue_url":"https://api.github.com/repos/bevacqua/dragula/issues/187","id":136821375,"user":{"login":"hnry","id":25837,"avatar_url":"https://avatars.githubusercontent.com/u/25837?v=3","gravatar_id":"","url":"https://api.github.com/users/hnry","html_url":"https://github.com/hnry","followers_url":"https://api.github.com/users/hnry/followers","following_url":"https://api.github.com/users/hnry/following{/other_user}","gists_url":"https://api.github.com/users/hnry/gists{/gist_id}","starred_url":"https://api.github.com/users/hnry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hnry/subscriptions","organizations_url":"https://api.github.com/users/hnry/orgs","repos_url":"https://api.github.com/users/hnry/repos","events_url":"https://api.github.com/users/hnry/events{/privacy}","received_events_url":"https://api.github.com/users/hnry/received_events","type":"User","site_admin":false},"created_at":"2015-09-01T18:31:44Z","updated_at":"2015-09-01T18:31:44Z","body":"Either way sounds fine, either... directly getting the element that's being dropped on, or elements in between (because you can figure out which element got dropped on).\r\n\r\n\r\nFor instance imagine this example:\r\nsource -> `Shirt - Sweater - Pants`\r\ntarget -> `Shirt - Sweater - Pants`\r\n\r\nI drag from my source a Sweater on to a target Sweater (now I can write code to have 2 sweaters).\r\n`Shirt - Sweater (2) - Pants`\r\n\r\nSo `.on('drop')` should provide a way for us to figure out where it was dropped within the target container itself. So either approach mentioned is fine as long as we can figure out where it was dropped.\r\n\r\nI think `elementBehindCursor` is probably more accurate.\r\n\r\n"}}