Drop Targets for Drag
John Redhead
What I'd like to see is a drag target condition within the drag trigger. At the moment the logic to create a drop target becomes excessive, especially if you have multiple drop targets on the screen, as you have to set these for the item being dragged. Not sure if it's me but when having created multiple drop targets the long way, they are fixed to the origin of the item being dragged. One of my projects involved a panel that was partially visible on the right that items could be dragged to, but when I then expanded that panel to bring it centrally onto the screen the drag target points were no longer in the place they should be, as they were relative to the item being dragged, and not the actual target.
This was for a tablet project, therefore allowing more of a drag action.
Drop Targets would allow the logic to be completed in the back end, allowing those drop targets to move, within scroll containers if neccesary, but still allowing them to perform an action where needed.
Patricia (ProtoPie Team)
Merged in a post:
Proximity jump to position
trevor gilchrist
Is there any capability to define a target area — either a zone, or another object — that dragged objects could snap to when they get close.
Use case examples might include dragging a square image close to another, and having it snap against it to create the beginnings of a row or column.
John Redhead
I made a request a couple of years ago for drag targets. If you’re in the slack group you’ll see how I’ve tried to address this with drag/drop deletion of folders.
Patricia (ProtoPie Team)
John Redhead: We've merged it into your request ;)
Darren Bennett
Just bringing this request back to the surface Patricia (ProtoPie Team)
Patricia (ProtoPie Team)
Merged in a post:
IN condition
Simon AUDRIX
Hi ProtoPie !
I've just been working on a really complex prototype including lot's of drag and drop interactions and reactions.
This made me realize that to the best of my knowledge, there is no easy way to detect where a drop happens ! It would actually be a real improvement to be able to state a "if in" condition when evaluating the mouse up trigger.
Now the only way to see wether or not an object has been released on top of a specific area is either to set a 4 way condition on maxX minX and maxY minY and "hardcode"-it (the area) in the conditional statement or if you want a dynamic behavior you have to compare mouseX and mouseY with the bounds of a component and it's even harder if the target drop component is inside of a group because you have to convert mouse position in relative group space to target the component location specifically. I'm not saying evaluating a drop zone can't be done, but it could be greatly improved using a IN statement saying: "is my drop action IN a specific component/area" meaning IN the bounds !
Thank you for the support ! And again, i'm french so sorry if my English isn't at its top and don't hesitate to ask question if i'm not clear...
John Redhead
I asked for the same feature overa year ago Simon AUDRIX https://protopie.canny.io/feature-requests/p/drag-targets
Simon AUDRIX
There's actually another way of doing this, it's using a hover in and out on the target area/component and assign a value depending on wether or not you're in the target zone. And then on the mouse up trigger watch that variable to detect if the drop should interact as part of the target zone or outside of it. But even like this it's not a piece of cake and clearly not easy as pie 😉
Patricia (ProtoPie Team)
Simon AUDRIX: thank you for giving us feedback on this! We'll make sure our product team check this out ;)
Ps: your English is fine ^^
Simon AUDRIX
Patricia (ProtoPie Team): reading the comment from John Redhead may be the topics could be merge in some way ?
Patricia (ProtoPie Team)
Simon AUDRIX: thank you, it's done ^^
John Redhead
After helping someone on ProtoPie users on FB I think the principle would be a trigger of isOver. Ie set a trigger on ball isOver the Yellow Box. The back end would process all of the complex, but necessary ranges and chains. Here’s a pie I shared with the person asking the question. https://cloud.protopie.io/p/b02d9f7453