-
Notifications
You must be signed in to change notification settings - Fork 30
fix(components-native): Fix Form's bottom inset SafeArea for inline type FormActionBar #2813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix(components-native): Fix Form's bottom inset SafeArea for inline type FormActionBar #2813
Conversation
| }: FormBodyProps): JSX.Element { | ||
| const paddingBottom = useBottomPadding(); | ||
| const fullViewPadding = useMemo(() => ({ paddingBottom }), [paddingBottom]); | ||
| const { bottom: paddingBottom } = useSafeAreaInsets(); |
There was a problem hiding this comment.
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.
| </View> | ||
|
|
||
| {shouldRenderActionBar && !saveButtonOffset && ( | ||
| {!saveButtonOffset && ( |
There was a problem hiding this comment.
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
| ref={scrollViewRef} | ||
| {...keyboardProps} | ||
| extraHeight={headerHeight} | ||
| extraScrollHeight={edgeToEdgeEnabled ? tokens["space-large"] : 0} |
There was a problem hiding this comment.
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
|
Published Pre-release for 547612b with versions: To install the new version(s) for Mobile run: |
|
Blocking this guy for when we resume this a little later. Keeping PR around as we might still use this |
Motivations
Form's FormActionBar (save button) on Android devices with edge-to-edge enabled was showing Form content over the navigation. This PR adds a fix to add proper insets for "inline" style FormActionBar
Before
After
Changes
Fixed
Testing
I tested using three Android emulators.
One with Android 14, two with Android 16 (one using gesture navigation, the other button navigation)
Use an android build with edge-to-edge enabled.
Load up a form long enough that it has a scroll.
Notice that on the Android that supports edge-to-edge (15+), the form content is not visible over the bottom system navigation bar
Changes can be
tested via Pre-release