Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Calculate correct keyboard offset in composer (#4500)

* calculate correct keyboard offset

* give viewHeight a default value

* much simpler approach

authored by

Samuel Newman and committed by
GitHub
d20c59e1 498e46ae

+17 -2
+17 -2
src/view/com/composer/Composer.tsx
··· 415 415 bottomBarAnimatedStyle, 416 416 } = useAnimatedBorders() 417 417 418 + const keyboardVerticalOffset = useKeyboardVerticalOffset() 419 + 418 420 return ( 419 421 <KeyboardAvoidingView 420 422 testID="composePostView" 421 423 behavior={isIOS ? 'padding' : 'height'} 422 - keyboardVerticalOffset={isIOS ? 70 : 0} 423 - style={[a.flex_1]}> 424 + keyboardVerticalOffset={keyboardVerticalOffset} 425 + style={a.flex_1}> 424 426 <View style={[a.flex_1, viewStyles]} aria-modal accessibilityViewIsModal> 425 427 <Animated.View style={topBarAnimatedStyle}> 426 428 <View style={styles.topbarInner}> ··· 739 741 topBarAnimatedStyle, 740 742 bottomBarAnimatedStyle, 741 743 } 744 + } 745 + 746 + function useKeyboardVerticalOffset() { 747 + const {top} = useSafeAreaInsets() 748 + 749 + // Android etc 750 + if (!isIOS) return 0 751 + 752 + // iPhone SE 753 + if (top === 20) return 40 754 + 755 + // all other iPhones 756 + return top + 10 742 757 } 743 758 744 759 const styles = StyleSheet.create({