Skip to content

Commit f90978d

Browse files
authored
fix: fix safe area by changing layout (#295)
2 parents fca6b47 + 03faa09 commit f90978d

File tree

4 files changed

+13
-24
lines changed

4 files changed

+13
-24
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ 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 navigation buttons were being overlapped due to improper safe area handling.
10+
11+
## [3.1.0] - 2025-4-25
12+
913
- We fixed the issue where the header is going outside of page in some android versions.
1014

1115
## [3.0.1] - 2025-3-18

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>

0 commit comments

Comments
 (0)