Skip to content

faltlist 设置 inverted 后绑定事件无效 #51

@hangaoke1

Description

@hangaoke1

描述 / Description

import React, { useEffect } from 'react';
import { FlatList, Pressable, Text, View } from 'react-native';
import {
  BaseButton,
  Gesture,
  GestureDetector,
  GestureHandlerRootView,
  ScrollView,
  TouchableOpacity,
} from 'react-native-gesture-handler';
type Props = {};

const LoadingDemo = (props: Props) => {
  const scrollRef = React.useRef<any>(null);
  const [data, setData] = React.useState<any[]>([]);

  return (
    <View>
      <View style={{ height: 500, width: '100%' }}>
        <FlatList
          data={['1', '2', '3', '4', '5', '6', '7']}
          inverted={true}
          windowSize={10}
          maxToRenderPerBatch={10}
          keyExtractor={(item) => {
            return item;
          }}
          renderItem={({ item }) => {
            return (
              <TouchableOpacity
                key={item}
                onPress={() => {
                  console.log('>>> 父元素点击');
                }}
                onLongPress={() => {
                  console.log('>>> 父元素长按');
                }}
              >
                <View style={{ width: 100, height: 100, backgroundColor: 'blue' }}>
                  <TouchableOpacity
                    onLongPress={() => {
                      console.log('>>> 子元素长按');
                    }}
                    onPress={() => {
                      console.log('>>> 子元素点击');
                    }}
                  >
                    <View style={{ width: 30, height: 30, backgroundColor: 'red' }}>
                      <Text>{item}</Text>
                    </View>
                  </TouchableOpacity>
                </View>
              </TouchableOpacity>
            );
          }}
        />
      </View>
    </View>
  );
};

export default LoadingDemo;

测试发现 tranform rotate 或者 scaleY 同样也有问题

复现步骤 / Steps to reproduce

No response

库版本 / Library version

2.14.17-rc.0

React Native OpenHarmony version

0.72.53

构建类型 / Build type

None

设备 / Device

None

设备版本 / Device model

No response

已悉知 / Acknowledgements

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions