-
Notifications
You must be signed in to change notification settings - Fork 92
Open
Description
I think this may be related to this issue: #89 . I am also seeing if there is any feedback on StackOverflow.
By setting the shouldReverse prop to true, the draggable item smoothly returns to its original position.
However, I can't seem to dynamically update the "original position" of the draggable item by updating the position.x and position.y values, as in the following code:
<View style={styles.answerContainer}>
{answerParts.map((item, index) => (
<Draggable
key={item.index}
x={item.position.x}
y={item.position.y}
disabled={item.placed}
shouldReverse={!item.placed}
onDragRelease={(event) => onReleaseItem(item, event)}
>
<View style={styles.draggableItem}>
<Text style={styles.draggableText}>{item.text}</Text>
</View>
</Draggable>
))}
</View>
Any thoughts on how I can properly change the original location of a draggable React Native component?
Thanks!
Metadata
Metadata
Assignees
Labels
No labels