Skip to content

Commit

Permalink
LayoutAnimation on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
tero-paananen committed May 2, 2022
1 parent b873733 commit fafd161
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "DraggableFlatList",
"version": "1.0.0",
"version": "1.0.1",
"private": true,
"author": {
"name": "Tero Paananen",
Expand Down
3 changes: 2 additions & 1 deletion src/DraggableItem.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useMemo, useCallback, useRef } from 'react';
import { View, StyleSheet } from 'react-native';
import { View, StyleSheet, LayoutAnimation, Platform } from 'react-native';
import { DraggableFlatListItem } from './DraggableFlatList';

type DraggableItemType = {
Expand Down Expand Up @@ -34,6 +34,7 @@ const DraggableItem = ({
const color = isBelow ? '#ededed' : 'transparent';
return { ...{ backgroundColor: color }, ...{ height: itemHeight } };
} else {
Platform.OS === 'ios' && isBelow && LayoutAnimation.easeInEaseOut();
const height = isBelow ? itemHeight * 2 : itemHeight;
return Boolean(userIsScrollingUp) === true
? [styles.up, { height: height }]
Expand Down

0 comments on commit fafd161

Please sign in to comment.