Skip to content
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.

Commit

Permalink
Fix LayoutAnimation.easeInEaseOut bug
Browse files Browse the repository at this point in the history
  • Loading branch information
gazedash authored Mar 22, 2019
1 parent b39a499 commit c128299
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ const initialState = {

// Note using LayoutAnimation.easeInEaseOut() was causing blank spaces to
// show up in list: https://github.com/facebook/react-native/issues/13207
const layoutAnimConfig = {
duration: 300,
create: {
type: LayoutAnimation.Types.easeInEaseOut,
property: LayoutAnimation.Properties.scaleXY,
},
update: {
type: LayoutAnimation.Types.easeInEaseOut,
property: LayoutAnimation.Properties.scaleXY,
}
}
// const layoutAnimConfig = {
// duration: 300,
// create: {
// type: LayoutAnimation.Types.easeInEaseOut,
// property: LayoutAnimation.Properties.scaleXY,
// },
// update: {
// type: LayoutAnimation.Types.easeInEaseOut,
// property: LayoutAnimation.Properties.scaleXY,
// }
// }

class SortableFlatList extends Component {
_moveAnim = new Animated.Value(0)
Expand Down Expand Up @@ -191,7 +191,7 @@ class SortableFlatList extends Component {
if (activeRow === -1) return
const nextSpacerIndex = this.getSpacerIndex(this._move, activeRow)
if (nextSpacerIndex > -1 && nextSpacerIndex !== this._spacerIndex) {
LayoutAnimation.configureNext(layoutAnimConfig);
// LayoutAnimation.configureNext(layoutAnimConfig);
this.setState({ spacerIndex: nextSpacerIndex })
this._spacerIndex = nextSpacerIndex
if (nextSpacerIndex === data.length) this._flatList.scrollToEnd()
Expand Down Expand Up @@ -442,4 +442,4 @@ const styles = StyleSheet.create({
},
wrapper: { flex: 1, opacity: 1 },
fullOpacity: { opacity: 1 }
})
})

0 comments on commit c128299

Please sign in to comment.