Forum Discussion
How to reset the state on a swapped drag-n-drop object?
I haven't been able to find any suitable solutions on the forums or through extensive trigger manipulation, so I'm curious if this is by design or a bug. I posted this to support as well and will update accordingly if appropriate.
Let's say that I have a freeform drag-n-drop interaction with 2 drag objects and 1 drop target. Both of the drag objects have multiple states which are independently updated when either object is dragged over or dropped onto the target. I can also use an invisible 'reset' box underneath the interaction area that will trigger a state change when either of the objects is dragged off of the trigger BY THE USER, thus resetting their state before dropping back to their original location.
However, if drag object 1 is already on the target (and it's state has been updated by a trigger) and then I drop object 2 on to the same target (which will then update the state of object 2 by use of a trigger), object 1 is thus returned back to it's starting position BUT the state of object 1 is NOT updated back to it's default state.
It appears that the only way to actually update the state of any object is through actual user interaction like dragging or clicking, but when the objects are swapped out because of the "allow only one item in each drop target" is enabled, how do we reset the drag object that's pushed back? How do we create a trigger on an object that happens when it's swapped? The invisible 'reset' box which does contain a trigger to reset the state only fires if I'm actually dragging the object, and NOT if the object is placed back on the reset area through the swapping action. This creates a major visual UI issue since it doesn't take long for the drag objects to be displaying the incorrect state, ie, not the default "normal" state.
- MariaElenaHernaCommunity Member
I created a drag-and-drop where I had to subtract points if a correct drop was replaced by an incorrect drop. Part of that setup may apply to this situation. I made a trigger to change the state of Object 1 to "normal," when Object 2 (or any other object) is dropped into the Object 1's target.
You mentioned multiple states for the objects, so I don't know if that will help.