Skip to content

Commit 1620387

Browse files
fix: [ScreenFooter] - Fix taps absorbed in footer area on Android (physical devices)
Made-with: Cursor
1 parent 44ba28d commit 1620387

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

  • packages/react-native-ui-lib/src/components/screenFooter

packages/react-native-ui-lib/src/components/screenFooter/index.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ const ScreenFooter = (props: ScreenFooterProps) => {
226226

227227
const childrenArray = React.Children.toArray(children).slice(0, 3).map(renderChild);
228228

229+
const isStaticVisible = animationDuration === 0 && visible;
230+
229231
const renderFooterContent = useCallback(() => {
230232
return (
231233
<>
@@ -238,6 +240,21 @@ const ScreenFooter = (props: ScreenFooterProps) => {
238240
}, [renderBackground, testID, contentContainerStyle, childrenArray]);
239241

240242
if (keyboardBehavior === KeyboardBehavior.HOISTED) {
243+
if (isStaticVisible) {
244+
return (
245+
<View pointerEvents="box-none" style={styles.container}>
246+
<Keyboard.KeyboardAccessoryView
247+
renderContent={renderFooterContent}
248+
kbInputRef={undefined}
249+
scrollBehavior={Keyboard.KeyboardAccessoryView.scrollBehaviors.FIXED_OFFSET}
250+
useSafeArea={false}
251+
manageScrollView={false}
252+
revealKeyboardInteractive
253+
onHeightChanged={setHeight}
254+
/>
255+
</View>
256+
);
257+
}
241258
return (
242259
<Animated.View style={[styles.container, hoistedAnimatedStyle]} pointerEvents={visible ? 'box-none' : 'none'}>
243260
<Keyboard.KeyboardAccessoryView
@@ -253,6 +270,14 @@ const ScreenFooter = (props: ScreenFooterProps) => {
253270
);
254271
}
255272

273+
if (isStaticVisible) {
274+
return (
275+
<View testID={testID} onLayout={onLayout} pointerEvents="box-none" style={styles.container}>
276+
{renderFooterContent()}
277+
</View>
278+
);
279+
}
280+
256281
return (
257282
<Animated.View testID={testID} onLayout={onLayout} style={[styles.container, stickyAnimatedStyle]}>
258283
{renderFooterContent()}

0 commit comments

Comments
 (0)