File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import Animated, {
1313 withSpring ,
1414} from "react-native-reanimated" ;
1515import CellRendererComponent from "./CellRendererComponent" ;
16- import { DEFAULT_PROPS } from "../constants" ;
16+ import { DEFAULT_PROPS , isWeb } from "../constants" ;
1717import PlaceholderItem from "./PlaceholderItem" ;
1818import RowItem from "./RowItem" ;
1919import { DraggableFlatListProps } from "../types" ;
@@ -170,14 +170,18 @@ function DraggableFlatListInner<T>(props: DraggableFlatListProps<T>) {
170170 newData . splice ( from , 1 ) ;
171171 newData . splice ( to , 0 , data [ from ] ) ;
172172 }
173- setTimeout ( ( ) => {
173+ const reset = ( ) => {
174174 activeIndexAnim . value = - 1 ;
175175 spacerIndexAnim . value = - 1 ;
176176 touchTranslate . value = 0 ;
177177 activeCellSize . value = - 1 ;
178178 activeCellOffset . value = - 1 ;
179179 setActiveKey ( null ) ;
180- } ) ;
180+ } ;
181+
182+ if ( isWeb ) reset ( ) ;
183+ else setTimeout ( reset ) ;
184+
181185 onDragEnd ( { from, to, data : newData } ) ;
182186 }
183187 }
You can’t perform that action at this time.
0 commit comments