Forum Discussion
Drag and Drop With Feedback Layers BUT NOT Correct or Incorrect
- 22 days ago
Although ThierryEMMANUEL has figured out a solution, I would still like to try a simpler version without using a tons of triggers.
I use the built‑in drag‑and‑drop function so that objects can return to the start area when a target is occupied. I also prefer using "state" for counting the TotalPlaced value and rely on two triggers to change the state.
What the built‑in model cannot change is that when another item is dropped on the same target, the original item still remains in the "placed" state even after returning to its initial position. Since this is the only issue in my solution, I thought—why not use the new AI assistant to solve the problem? Below is the prompt I gave the AI assistant, and it worked as expected. A single JavaScript snippet solved it.
Change the state of crit# to normal when they moves onto hotspot1 area. For example, change crit9 to normal when it moves onto hotspot1.
Here is my version3. As Nedim said, I also value discussions like this and gracful learn something from each other. Thank you!
Hi ThierryEMMANUEL,
I didn’t realize that the state would change to dropIncorrect when the item dropped outside the designated drop areas. This should be taken into account because it could happen in the real world—we never know what users might do, LOL. So, I moved the hotspot to the start area and changed the trigger to:
- Change the state to normal when crit# is dropped on the hotspot (inital area).
ELOUPEI, I hope this fixed the issue you encountered.
Thank you very much for continuing to update your work JoanneChen (unfortunately, I feel like I'm the only one who noticed...). I checked your demo and, not quite, there's still a small problem 🙂. If I move a proposition (for example, number 2 in the screenshot) and then move it back to the starting area because I changed my mind (which is more “normal” behavior than what I did in my previous response), the “Total Placed” counter remains at 1 even though the drop zone is empty. I can do this four times in a row with four different proposals and set the “Total Placed” to 4 and get the Next button...
- JoanneChen23 days agoSuper Hero
Hi ThierryEMMANUEL,
Thanks for checking! I realized I hadn’t uploaded my second version of the file. In this version, users can change their mind and move the item back to the start zone without affecting the counter.
I also took a look at your file—well done! You used a different approach and really nailed it.- Nedim23 days agoCommunity Member
Hi JoanneChen
If the user moves an item back to the start zone in a certain way and then places it back into a drop zone, it can mess up the actual number of items in the drop zones, but the calculated number may still display correctly for validating the interaction. It’s obvious that a previously dropped object does not revert to its Normal state when it is removed from the drop zone, either because it was bumped by another dragged object or moved back by the user.- JoanneChen21 days agoSuper Hero
Hi Nedim,
Thank you for checking my file and pointing out the issue. I didn’t notice that it would remain in the "placed" state or switch to "drop-incorrect" when a user drops items outside the targets. Rather than trying to find a workaround using built‑in feature triggers, I decided to use the new AI assistant to solve the problem. And it beatifully solve the issue with a simple JS code! Love it!
Related Content
- 4 months ago