Description
Hi,
thanx for this nice tutorial.
I tried your code running in Android simulator. I read the console.log in onPanResponderMove method with the state with the array of tags.
onPanResponderMove = (gestureState : GestureState) : void => {
const {moveX, moveY} = gestureState;
console.log('onPanResponderMove', moveX, moveY);
console.log('this.tagBeingDragged');
console.log(this.tagBeingDragged);
console.log('this.state');
console.log(this.state);
// Do nothing if dnd is disabled
if (!this.state.dndEnabled) {
return;
}
// Find the tag we're dragging the current tag over
const draggedOverTag = this.findTagAtCoordinates(moveX, moveY, this.tagBeingDragged);
if (draggedOverTag) {
this.swapTags(this.tagBeingDragged, draggedOverTag);
}
};
Just after startign the app the tlY value is correct for all tags.
After dragging down or up a tag the tlY value in the tag array isnt correct anymore.
The problem is, when you drag a tag (maybe with index 3), the value in title of this.tagBeingDragged is not the same as the tag I startet to drag (it`s index 4 or another then), because the array with the tags seems to contain the wrong values for their position.
Does anybody have the same issue?
I tried it with react native 0.54, because previous versions had a bug with remote debugging.
EDIT:
I tried the original code here and the only change was the
constructor() {
super();
// Enable LayoutAnimation under Android
if (Platform.OS === 'android') {
UIManager.setLayoutAnimationEnabledExperimental && UIManager.setLayoutAnimationEnabledExperimental(true);
}
}
in the tagsarea component.
Same problem here.