Skip to content

Commit

Permalink
fix: delay after keyboard is dismissed (#342)
Browse files Browse the repository at this point in the history
memoize translateY value to update when keyboard dismisses
  • Loading branch information
rcb4t2 authored Mar 31, 2022
1 parent 59d51d1 commit 73497fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hooks/useSlideAnimation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function useSlideAnimation({
}).start();
}, []);

const translateY = animatedValue.current.interpolate({
const translateY = React.useMemo(() => animatedValue.current.interpolate({
inputRange: [0, 1],
outputRange: translateYOutputRangeFor({
position,
Expand All @@ -64,7 +64,7 @@ export function useSlideAnimation({
keyboardHeight,
keyboardOffset
})
});
}), [position, height, topOffset, bottomOffset, keyboardHeight, keyboardOffset]);

const opacity = animatedValue.current.interpolate({
inputRange: [0, 0.7, 1],
Expand Down

0 comments on commit 73497fa

Please sign in to comment.