computerjazz / react-native-draggable-flatlist

A drag-and-drop-enabled FlatList for React Native
MIT License
1.96k stars 413 forks source link

[RTL][Android][Horizontal] Odd behaviour while dragging #343

Open muja555 opened 2 years ago

muja555 commented 2 years ago

Describe the bug Odd behaviour while dragging on RTL as seen in gif below (Android device): Untitled

To Reproduce list:

 <DraggableFlatList
                ref={ref}
                horizontal={true}
                data={images}
                renderItem={renderItem}
                onDragEnd={onDragEnd}
                contentContainerStyle={{
                    flexGrow: 1,
                    flexDirection: 'row',
                }}
                initialScrollIndex={0}
                keyExtractor={item => item.id}
            />

renderItem:

    const renderItem = ({item, drag, index, isActive}) => {
        return (
            <TouchableOpacity key={item.id}
                              disabled={isActive}
                              onLongPress={drag}>
               <!-- content -->
            </TouchableOpacity>
        );
    }

enabling rtl on app start:

I18nManager.allowRTL(true);
I18nManager.forceRTL(true);

Platform & Dependencies

computerjazz commented 2 years ago

Weird! This looks like an issue with RN flatlist: https://github.com/facebook/react-native/issues/19150