Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
revert: upstream fix (#586) due to reorder flickering
  • Loading branch information
outaTiME committed Jul 3, 2025
commit 4b637740f1a0969b05cbb8ebead773f857b0d670
13 changes: 12 additions & 1 deletion src/components/CellRendererComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
LayoutChangeEvent,
MeasureLayoutOnSuccessCallback,
StyleProp,
StyleSheet,
ViewStyle,
} from "react-native";
import Animated, {
Expand Down Expand Up @@ -162,7 +163,11 @@ function CellRendererComponent<T>(props: Props<T>) {
? itemLayoutAnimation
: undefined
}
style={[props.style, baseStyle, animStyle]}
style={[
props.style,
baseStyle,
activeKey ? animStyle : styles.zeroTranslate,
]}
pointerEvents={activeKey ? "none" : "auto"}
>
<CellProvider isActive={isActive}>{children}</CellProvider>
Expand All @@ -172,6 +177,12 @@ function CellRendererComponent<T>(props: Props<T>) {

export default typedMemo(CellRendererComponent);

const styles = StyleSheet.create({
zeroTranslate: {
transform: [{ translateX: 0 }, { translateY: 0 }],
},
});

declare global {
namespace NodeJS {
interface Global {
Expand Down
13 changes: 2 additions & 11 deletions src/components/DraggableFlatList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ import React, {
useRef,
useState,
} from "react";
import {
ListRenderItem,
FlatListProps,
LayoutChangeEvent,
InteractionManager,
} from "react-native";
import { ListRenderItem, FlatListProps, LayoutChangeEvent } from "react-native";
import {
FlatList,
Gesture,
Expand Down Expand Up @@ -120,9 +115,6 @@ function DraggableFlatListInner<T>(props: DraggableFlatListProps<T>) {
if (dataHasChanged) {
// When data changes make sure `activeKey` is nulled out in the same render pass
activeKey = null;
InteractionManager.runAfterInteractions(() => {
reset();
});
}

useEffect(() => {
Expand Down Expand Up @@ -230,8 +222,7 @@ function DraggableFlatListInner<T>(props: DraggableFlatListProps<T>) {
}

onDragEnd?.({ from, to, data: newData });

setActiveKey(null);
reset();
}
);

Expand Down