Replies: 4 comments 8 replies
|
@kirillzyusko First of all, thank you for the quick response. P.S. That white area is supposed to be gray, but ever since I added statusBarTranslucent, I’ve been seeing what’s shown in the screenshot. |
|
Hi @kirillzyusko , I just got back from vacation so I finally had a chance to focus on the code related to the keyboard provider. I managed to fix the padding issues on all screens except one, but that’s a minor issue which I’ll try to fix myself. I have one more question for you. If you get a chance, I’d appreciate it if you could take a look at the video. The animation on iOS is smooth, but on Android it stutters. Screen.Recording.2025-07-10.at.11.59.47.movHere’s a part of the code, maybe it’ll help. Thank you in advance for your time and support const topEdge = useMemo(() => {
if (buttonOffsetY && scrollHeight) return buttonOffsetY - scrollHeight;
return 0;
}, [buttonOffsetY, scrollHeight]);
const scrollToBottom = () => {
scrollViewRef.current?.scrollToEnd({ animated: true });
};
const onScroll = useAnimatedScrollHandler({
onScroll: (event) => {
scrollY.value = event.contentOffset.y;
if (event.contentOffset.y >= topEdge && !hintDismissed) {
runOnJS(setHintDismissed)(true);
}
},
});
return (
<>
<Stack.Screen
options={{
headerRight: () => (
<Pressable onPress={() => clearBasket()}>
<Text className="text-sm font-openSansSemiBold text-grayPrimary">
Obriši sve
</Text>
</Pressable>
),
}}
/>
<View className="flex-1 relative">
{topEdge > 0 && !hintDismissed && (
<ConfirmOrderHint
scrollY={scrollY}
scrollToBottom={scrollToButton}
topEdge={topEdge}
hasSufficientMonthlyAllowance={hasSufficientMonthlyAllowance}
hasSufficientDailyAllowance={hasSufficientDailyAllowance}
/>
)}
<KeyboardAwareScrollView
ref={scrollViewRef}
onScroll={onScroll}
className="flex-1 bg-white relative"
showsVerticalScrollIndicator={false}
scrollEventThrottle={16}
contentContainerStyle={{
minHeight: '100%',
justifyContent: 'space-between',
paddingBottom: isIos ? bottom || 16 : bottom + 16,
}}
onLayout={(e) => {
const rawHeight = e.nativeEvent.layout.height;
const adjustedHeight = isAndroid ? rawHeight - bottom : rawHeight;
setScrollHeight(adjustedHeight);
}}
>
<View>
<View className="flex-1 flex-row items-center justify-between p-4 gap-4">
<Text className="flex-1 text-base font-openSansSemiBold text-grayPrimary">
{title}
</Text>
{currentRestaurant?.restaurantProfilePicture && (
<View className="w-8 h-8 rounded-full overflow-hidden border border-grayPrimary20">
<Image
source={{
uri: restaurantProfilePicture,
}}
className="w-full h-full"
/>
</View>
)}
</View>
<ConfirmOrderList
hasSufficientMonthlyAllowance={hasSufficientMonthlyAllowance}
hasSufficientDailyAllowance={hasSufficientDailyAllowance}
/>
<ConfirmOrderNote />
{shouldShowTotalPrice && (
<ConfirmOrderPrice totalPrice={totalPrice} />
)}
</View>
<ConfirmOrderButton
setButtonOffsetY={setButtonOffsetY}
hasSufficientMonthlyAllowance={hasSufficientMonthlyAllowance}
hasSufficientDailyAllowance={hasSufficientDailyAllowance}
/>
</KeyboardAwareScrollView>
</View>
</>
); |
|
@fjuric can you tell me how you fixed this issue? I am experiencing the same bottom ghost space when i employ KeyboardProvider. On newer versions on Android no issue but on version like Android 9 is an issue. I have this in my app.config.json I have been trying with putting the provider at various levels of the tree i have been playing around with some of the props in the scrollview but yet the space persists. |

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
When I wrap my app with the keyboard provider, I notice a strange padding/margin at the bottom of each screen, regardless of whether I'm using anything from the package on that screen or not. I should mention that I'm also using react-native-safe-area-context, specifically the useSafeAreaInsets() hook, which ensures that content stays within the allowed top and bottom boundaries. I don’t experience any issues on iOS devices, and this problem doesn't even occur on all Android devices. I notice it on certain Android devices—especially those with a navigation bar at the bottom—where there’s extra space between the navigation bar and the content above it. Unfortunately, I can’t reproduce this effect using Android emulators; it's only visible on those specific Android devices I'm testing on. It’s also worth mentioning that I’m using KeyboardAwareScrollView with a bottomOffset, in case that helps someone further identify the issue.
Platform: Android (no issue on iOS)
Expo SDK: ~52.0.46
React Native version: 0.76.9
react-native-keyboard-controller: ^1.17.2
All reactions