Skip to content

Tags confused in Android simulator #4

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
frischka opened this issue Mar 31, 2018 · 0 comments
Open

Tags confused in Android simulator #4

frischka opened this issue Mar 31, 2018 · 0 comments

Comments

@frischka
Copy link

frischka commented Mar 31, 2018

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant