Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/components-native/src/Form/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ function InternalForm<T extends FieldValues, S>({
ref={scrollViewRef}
{...keyboardProps}
extraHeight={headerHeight}
extraScrollHeight={edgeToEdgeEnabled ? tokens["space-large"] : 0}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@omairJobber this did not seem necessary with this fix

contentContainerStyle={
!keyboardHeight && styles.scrollContentContainer
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useMemo } from "react";
import React from "react";
import { View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import { useStyles } from "./FormBody.style";
import { useScreenInformation } from "../../hooks/useScreenInformation";
import type { FormActionBarProps } from "../FormActionBar";
Expand All @@ -25,13 +26,12 @@ export function FormBody({
setSaveButtonHeight,
saveButtonOffset,
}: FormBodyProps): JSX.Element {
const paddingBottom = useBottomPadding();
const fullViewPadding = useMemo(() => ({ paddingBottom }), [paddingBottom]);
const { bottom: paddingBottom } = useSafeAreaInsets();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useBottomPadding was doing some extra minuses for padding.. I needed the unaltered value from SafeAreaInsets.

const styles = useStyles();

return (
<>
<View style={[styles.container]}>
<View style={styles.container}>
{children}
{shouldRenderActionBar && (
<FormActionBar
Expand All @@ -47,9 +47,9 @@ export function FormBody({
)}
</View>

{shouldRenderActionBar && !saveButtonOffset && (
{!saveButtonOffset && (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the crux of the fix, where I show this extra "safeArea" view at all times
for iOS and Android <15, this view is zero height

<View
style={[fullViewPadding, styles.safeArea]}
style={[{ paddingBottom }, styles.safeArea]}
testID="ATL-FormSafeArea"
/>
)}
Expand Down