Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

- We fixed the issue where navigation buttons were being overlapped due to improper safe area handling.

## [3.1.0] - 2025-4-25

- We fixed the issue where the header is going outside of page in some android versions.

## [3.0.1] - 2025-3-18
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "safe-area-view-native",
"widgetName": "SafeAreaView",
"version": "3.1.0",
"version": "3.1.1",
"license": "Apache-2.0",
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,18 @@ import { flattenStyles } from "@mendix/piw-native-utils-internal";
import { SafeAreaViewStyle, defaultSafeAreaViewStyle } from "./ui/Styles";
import { SafeAreaViewProps } from "../typings/SafeAreaViewProps";
import { SafeAreaView as SafeAreaViewComponent } from "react-native-safe-area-context";
import { useBottomTabBarHeight } from "@react-navigation/bottom-tabs";
import { View } from "react-native";

export function useSafeBottomTabBarHeight(): number {
try {
const height = useBottomTabBarHeight();
return height;
} catch (e) {
return 0;
}
}

export const SafeAreaView = (props: SafeAreaViewProps<SafeAreaViewStyle>): JSX.Element => {
const styles = flattenStyles(defaultSafeAreaViewStyle, props.style);
const tabBarHeight = useSafeBottomTabBarHeight();

const isBottomBarActive = tabBarHeight > 0;
return (
<SafeAreaViewComponent
edges={isBottomBarActive ? ["top", "left", "right"] : undefined}
style={{ flex: 1, ...{ backgroundColor: styles.container.backgroundColor } }}
pointerEvents={"box-none"}
testID={props.name}
>
<View style={styles.container} pointerEvents={"box-none"}>
{props.content}
</View>
</SafeAreaViewComponent>
<View style={{ flex: 1, backgroundColor: styles.container.backgroundColor }}>
<SafeAreaViewComponent style={{ flex: 1 }} pointerEvents={"box-none"} testID={props.name}>
<View style={styles.container} pointerEvents={"box-none"}>
{props.content}
</View>
</SafeAreaViewComponent>
</View>
);
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://www.mendix.com/package/1.0/">
<clientModule name="SafeAreaView" version="3.1.0" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="SafeAreaView" version="3.1.1" xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="SafeAreaView.xml" />
</widgetFiles>
Expand Down