diff --git a/src/components/KeyboardAvoidingView/index.tsx b/src/components/KeyboardAvoidingView/index.tsx index c29e9e7b5d..ba162c29d0 100644 --- a/src/components/KeyboardAvoidingView/index.tsx +++ b/src/components/KeyboardAvoidingView/index.tsx @@ -139,13 +139,16 @@ const KeyboardAvoidingView = forwardRef< ); const animatedStyle = useAnimatedStyle(() => { + if (!enabled) { + return {}; + } + const bottom = interpolateToRelativeKeyboardHeight( keyboard.progress.value, ); const translateY = interpolateToRelativeKeyboardHeight(translate.value); const paddingBottom = interpolateToRelativeKeyboardHeight(padding.value); - const bottomHeight = enabled ? bottom : 0; - const height = frame.value.height - bottomHeight; + const height = frame.value.height - bottom; switch (behavior) { case "height": @@ -159,10 +162,10 @@ const KeyboardAvoidingView = forwardRef< return {}; case "position": - return { bottom: bottomHeight }; + return { bottom }; case "padding": - return { paddingBottom: bottomHeight }; + return { paddingBottom: bottom }; case "translate-with-padding": return {