Skip to content

Commit eeba7e0

Browse files
authored
fix: fix safe area overlapping issue with navigation bar (#296)
2 parents 97e2394 + 379f410 commit eeba7e0

File tree

5 files changed

+15
-26
lines changed

5 files changed

+15
-26
lines changed

packages/pluggableWidgets/safe-area-view-native/CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9-
- We fixed the issue where the header is going outside of page in some android versions.
9+
- We fixed the issue where navigation buttons were being overlapped due to improper safe area handling.
10+
11+
## [3.1.0] - 2025-4-25
12+
13+
- We fixed the issue where the header is going outside of page in some android versions.
1014

1115
### Changed
1216

packages/pluggableWidgets/safe-area-view-native/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "safe-area-view-native",
33
"widgetName": "SafeAreaView",
4-
"version": "3.1.0",
4+
"version": "3.1.1",
55
"license": "Apache-2.0",
66
"repository": {
77
"type": "git",

packages/pluggableWidgets/safe-area-view-native/src/SafeAreaView.tsx

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,18 @@ import { flattenStyles } from "@mendix/piw-native-utils-internal";
33
import { SafeAreaViewStyle, defaultSafeAreaViewStyle } from "./ui/Styles";
44
import { SafeAreaViewProps } from "../typings/SafeAreaViewProps";
55
import { SafeAreaView as SafeAreaViewComponent } from "react-native-safe-area-context";
6-
import { useBottomTabBarHeight } from "@react-navigation/bottom-tabs";
76
import { View } from "react-native";
87

9-
export function useSafeBottomTabBarHeight(): number {
10-
try {
11-
const height = useBottomTabBarHeight();
12-
return height;
13-
} catch (e) {
14-
return 0;
15-
}
16-
}
17-
188
export const SafeAreaView = (props: SafeAreaViewProps<SafeAreaViewStyle>): JSX.Element => {
199
const styles = flattenStyles(defaultSafeAreaViewStyle, props.style);
20-
const tabBarHeight = useSafeBottomTabBarHeight();
2110

22-
const isBottomBarActive = tabBarHeight > 0;
2311
return (
24-
<SafeAreaViewComponent
25-
edges={isBottomBarActive ? ["top", "left", "right"] : undefined}
26-
style={{ flex: 1, ...{ backgroundColor: styles.container.backgroundColor } }}
27-
pointerEvents={"box-none"}
28-
testID={props.name}
29-
>
30-
<View style={styles.container} pointerEvents={"box-none"}>
31-
{props.content}
32-
</View>
33-
</SafeAreaViewComponent>
12+
<View style={{ flex: 1, backgroundColor: styles.container.backgroundColor }}>
13+
<SafeAreaViewComponent style={{ flex: 1 }} pointerEvents={"box-none"} testID={props.name}>
14+
<View style={styles.container} pointerEvents={"box-none"}>
15+
{props.content}
16+
</View>
17+
</SafeAreaViewComponent>
18+
</View>
3419
);
3520
};

packages/pluggableWidgets/safe-area-view-native/src/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="SafeAreaView" version="3.1.0" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="SafeAreaView" version="3.1.1" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="SafeAreaView.xml" />
66
</widgetFiles>

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19939,4 +19939,4 @@ __metadata:
1993919939
readable-stream: "npm:^3.4.0"
1994019940
checksum: 10/57705f3b6d85735c6c64040800b10ee3738720a36492b3ca299603493574f0a4afd2f18f5fc7b5e910e5452cc8add3b4ff908fab5d4b897e109e9db46150cfbc
1994119941
languageName: node
19942-
linkType: hard
19942+
linkType: hard

0 commit comments

Comments
 (0)