From 457081a673877586ae763cf94534d5af3b46ee2a Mon Sep 17 00:00:00 2001 From: Brent Vatne Date: Fri, 14 Sep 2018 15:26:37 +0200 Subject: [PATCH] Clamp interpolated values --- src/views/StackView/StackViewStyleInterpolator.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/views/StackView/StackViewStyleInterpolator.js b/src/views/StackView/StackViewStyleInterpolator.js index 853518c..28cad8e 100644 --- a/src/views/StackView/StackViewStyleInterpolator.js +++ b/src/views/StackView/StackViewStyleInterpolator.js @@ -50,6 +50,7 @@ function forHorizontal(props) { const opacity = position.interpolate({ inputRange: [first, first + 0.01, index, last - 0.01, last], outputRange: [0, 1, 1, 0.85, 0], + extrapolate: 'clamp', }); const width = layout.initWidth; @@ -58,6 +59,7 @@ function forHorizontal(props) { outputRange: I18nManager.isRTL ? [-width, 0, width * 0.3] : [width, 0, width * -0.3], + extrapolate: 'clamp', }); const translateY = 0; @@ -85,12 +87,14 @@ function forVertical(props) { const opacity = position.interpolate({ inputRange: [first, first + 0.01, index, last - 0.01, last], outputRange: [0, 1, 1, 0.85, 0], + extrapolate: 'clamp', }); const height = layout.initHeight; const translateY = position.interpolate({ inputRange: [first, index, last], outputRange: [height, 0, 0], + extrapolate: 'clamp', }); const translateX = 0; @@ -120,11 +124,13 @@ function forFadeFromBottomAndroid(props) { const opacity = position.interpolate({ inputRange, outputRange: [0, 1, 1, 0], + extrapolate: 'clamp', }); const translateY = position.interpolate({ inputRange, outputRange: [50, 0, 0, 0], + extrapolate: 'clamp', }); const translateX = 0; @@ -152,6 +158,7 @@ function forFade(props) { const opacity = position.interpolate({ inputRange: [first, index, last], outputRange: [0, 1, 1], + extrapolate: 'clamp', }); return {