Skip to content

Commit 9bef4fc

Browse files
Copilotgrillinr
andauthored
Add KeyboardAvoidingView to all screens with text inputs (#135)
* Initial plan * Add KeyboardAvoidingView to all screens with text input fields Co-authored-by: grillinr <169214325+grillinr@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: grillinr <169214325+grillinr@users.noreply.github.com>
1 parent 6ae09d3 commit 9bef4fc

File tree

5 files changed

+35
-0
lines changed

5 files changed

+35
-0
lines changed

frontend/app/(auth)/sign-in.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import React, { useEffect, useRef, useState } from "react";
22
import {
33
ActivityIndicator,
44
Animated,
5+
KeyboardAvoidingView,
6+
Platform,
57
Pressable,
68
StyleSheet,
79
TextInput,
@@ -66,6 +68,10 @@ export default function SignInScreen() {
6668
style={[styles.screen, { backgroundColor: colors.background }]}
6769
edges={[]}
6870
>
71+
<KeyboardAvoidingView
72+
style={styles.screen}
73+
behavior={Platform.OS === "ios" ? "padding" : undefined}
74+
>
6975
<Animated.View
7076
style={[
7177
styles.content,
@@ -154,6 +160,7 @@ export default function SignInScreen() {
154160
</View>
155161
</View>
156162
</Animated.View>
163+
</KeyboardAvoidingView>
157164
</SafeAreaView>
158165
);
159166
}

frontend/app/(auth)/sign-up.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import React, { useEffect, useRef, useState } from "react";
22
import {
33
ActivityIndicator,
44
Animated,
5+
KeyboardAvoidingView,
6+
Platform,
57
Pressable,
68
StyleSheet,
79
TextInput,
@@ -70,6 +72,10 @@ export default function SignUpScreen() {
7072
style={[styles.screen, { backgroundColor: colors.background }]}
7173
edges={[]}
7274
>
75+
<KeyboardAvoidingView
76+
style={styles.screen}
77+
behavior={Platform.OS === "ios" ? "padding" : undefined}
78+
>
7379
<Animated.View
7480
style={[
7581
styles.content,
@@ -158,6 +164,7 @@ export default function SignUpScreen() {
158164
</View>
159165
</View>
160166
</Animated.View>
167+
</KeyboardAvoidingView>
161168
</SafeAreaView>
162169
);
163170
}

frontend/app/(tabs)/explore.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import {
1010
Animated,
1111
InteractionManager,
1212
Keyboard,
13+
KeyboardAvoidingView,
14+
Platform,
1315
Pressable,
1416
RefreshControl,
1517
ScrollView,
@@ -527,6 +529,10 @@ export default function ExploreScreen() {
527529
<View style={[styles.screen, { backgroundColor: colors.background }]}>
528530
<View style={styles.background} pointerEvents="none" />
529531
<SafeAreaView style={styles.safeArea} edges={["top"]}>
532+
<KeyboardAvoidingView
533+
style={styles.safeArea}
534+
behavior={Platform.OS === "ios" ? "padding" : undefined}
535+
>
530536
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
531537
<Animated.ScrollView
532538
ref={scrollRef}
@@ -955,6 +961,7 @@ export default function ExploreScreen() {
955961
) : null}
956962
</Animated.ScrollView>
957963
</TouchableWithoutFeedback>
964+
</KeyboardAvoidingView>
958965
</SafeAreaView>
959966
<TopBlur scrollY={scrollY} />
960967
<FloatingScrollTopButton

frontend/app/manage-streams.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import React, { useCallback, useEffect, useRef, useState } from "react";
22
import {
33
Alert,
44
Animated,
5+
KeyboardAvoidingView,
6+
Platform,
57
Pressable,
68
RefreshControl,
79
ScrollView,
@@ -215,6 +217,10 @@ export default function ManageStreamsScreen() {
215217
return (
216218
<View style={[styles.screen, { backgroundColor: colors.background }]}>
217219
<SafeAreaView style={styles.safeArea} edges={["top"]}>
220+
<KeyboardAvoidingView
221+
style={styles.screen}
222+
behavior={Platform.OS === "ios" ? "padding" : undefined}
223+
>
218224
<Animated.ScrollView
219225
ref={scrollRef}
220226
contentInsetAdjustmentBehavior="never"
@@ -461,6 +467,7 @@ export default function ManageStreamsScreen() {
461467
</View>
462468
)}
463469
</Animated.ScrollView>
470+
</KeyboardAvoidingView>
464471
</SafeAreaView>
465472
<TopBlur scrollY={scrollY} />
466473
<FloatingScrollTopButton

frontend/features/settings/shared.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import React, { useEffect, useRef } from "react";
22
import {
33
Animated,
4+
KeyboardAvoidingView,
5+
Platform,
46
Pressable,
57
ScrollView,
68
StyleSheet,
@@ -60,6 +62,10 @@ export function SettingsPageShell({
6062
return (
6163
<View style={[styles.screen, { backgroundColor: colors.background }]}>
6264
<SafeAreaView style={styles.screen} edges={["top"]}>
65+
<KeyboardAvoidingView
66+
style={styles.screen}
67+
behavior={Platform.OS === "ios" ? "padding" : undefined}
68+
>
6369
<Animated.ScrollView
6470
ref={scrollRef}
6571
onScroll={onScroll}
@@ -113,6 +119,7 @@ export function SettingsPageShell({
113119
<View style={styles.body}>{children}</View>
114120
</Animated.View>
115121
</Animated.ScrollView>
122+
</KeyboardAvoidingView>
116123
</SafeAreaView>
117124
<TopBlur scrollY={scrollY} />
118125
<FloatingScrollTopButton

0 commit comments

Comments
 (0)