fix(mobile): keyboard-avoidance i Screen så formulär inte göms bakom tangentbordet (FAS 35)
CI / Typecheck, test & build (push) Successful in 1m40s
CI / Typecheck, test & build (push) Successful in 1m40s
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import type { PropsWithChildren, ReactNode } from "react";
|
||||
import {
|
||||
ActivityIndicator,
|
||||
KeyboardAvoidingView,
|
||||
Platform,
|
||||
Pressable,
|
||||
ScrollView,
|
||||
StyleSheet,
|
||||
@@ -25,6 +27,7 @@ export function Screen({
|
||||
<ScrollView
|
||||
contentContainerStyle={[styles.screenContent, style]}
|
||||
keyboardShouldPersistTaps="handled"
|
||||
keyboardDismissMode="on-drag"
|
||||
>
|
||||
{children}
|
||||
</ScrollView>
|
||||
@@ -33,7 +36,12 @@ export function Screen({
|
||||
);
|
||||
return (
|
||||
<SafeAreaView style={styles.screen} edges={["top"]}>
|
||||
{content}
|
||||
<KeyboardAvoidingView
|
||||
style={{ flex: 1 }}
|
||||
behavior={Platform.OS === "ios" ? "padding" : undefined}
|
||||
>
|
||||
{content}
|
||||
</KeyboardAvoidingView>
|
||||
</SafeAreaView>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user