CaptainOmega / react-native-drag-resize

React Native component for draggable and resizable manipulation.
37 stars 41 forks source link

x and y coordinates not positioning the dragResizeBlock #5

Open sushmitg opened 4 years ago

sushmitg commented 4 years ago

I have an array of objects, where each object has x: 0 and y:0 properties. I am passing down these x and y values to the props of the same name to DragResizeBlock. I update these values onDragEnd event for the selected image. the values are correctly updated in array in the correct object at the correct index. Now, if I move an object say from index 2 to 1 the order of objects is changed. Now the UI re-renders and the draggable images stacking order are changed, which was the goal, as later elements are always on top in stacking order but the positions of both the images also get swapped whereas the positions shouldn't change. the positioning should be picked from the objects in array.