Skip to content

[Android] Invalid pointerId=-1 in onTouchEvent #3382

New issue

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

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

Already on GitHub? Sign in to your account

Closed
lovegaoshi opened this issue Feb 5, 2025 · 2 comments
Closed

[Android] Invalid pointerId=-1 in onTouchEvent #3382

lovegaoshi opened this issue Feb 5, 2025 · 2 comments
Assignees
Labels
Close when stale The issue will be closed automatically if it remains inactive Platform: Android This issue is specific to Android Repro provided A reproduction with a snack or repo is provided

Comments

@lovegaoshi
Copy link

Description

Hi!
migrating from this PR comment:

I noticed specifically on Android 15+ (real device OR emulator), when using FlashList as an Animated component (wrapped via RNGH's createNativeWrapper and Reanimated's Animated.createAnimatedComponent), while specifying RNGH's scrollView as flashlist's renderScrollComponent, the list no longer scrolls with Invalid pointerId=-1 in onTouchEvent on LogCat. The code is here. This is fine in RNGH prior to this PR or with a patch reverting dispatchTouchEvent to onTouchEvent, or on Android 14 (Samsung S21).

Steps to reproduce

  1. git clone
  2. yarn
  3. yarn build
  4. build via AS
  5. scroll

Snack or a link to a repository

https://github.com/lovegaoshi/azusa-player-mobile/tree/bug/RNGH-2.23.0

Gesture Handler version

2.23.0

React Native version

0.76.6

Platforms

Android

JavaScript runtime

None

Workflow

None

Architecture

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

@github-actions github-actions bot added Platform: Android This issue is specific to Android Repro provided A reproduction with a snack or repo is provided labels Feb 5, 2025
@m-bert m-bert self-assigned this Feb 12, 2025
@m-bert
Copy link
Contributor

m-bert commented Feb 12, 2025

Hi @lovegaoshi! We've looked at your repro and it seems that there's something wrong with this setup. createNativeWrapper should be used on ScrollComponent, not on the FlashList itself. Since you already have ScrollView from Gesture Handler, you don't have to use createNativeWrapper. In that case, the correct code would be:

import React from 'react';
import { Text } from 'react-native';
import {
  GestureHandlerRootView,
  ScrollView,
} from 'react-native-gesture-handler';
import { FlashList } from '@shopify/flash-list';
import Animated from 'react-native-reanimated';

const AnimatedFlashList = Animated.createAnimatedComponent(FlashList);

export default () => {
  return (
    <GestureHandlerRootView>
      <AnimatedFlashList
        data={Array.from(Array(100).keys())}
        renderItem={({ item }) => <Text>{item}</Text>}
        renderScrollComponent={ScrollView}
      />
    </GestureHandlerRootView>
  );
};

Does anything break in this scenario?

@m-bert m-bert added the Close when stale The issue will be closed automatically if it remains inactive label Feb 17, 2025
@lovegaoshi
Copy link
Author

tysm! seems okay and ill push to alpha. will re-open if it goes south

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Close when stale The issue will be closed automatically if it remains inactive Platform: Android This issue is specific to Android Repro provided A reproduction with a snack or repo is provided
Projects
None yet
2 participants