Skip to content

Conversation

@klxiaoniu
Copy link

Summary

The following code works fine on Android and iOS, but on Web the padding will be set to all edges despite what we set. When getEdgeValue is called with the third value undefined, which means the inset is not required, it will apply inset incorrectly.

import { SafeAreaView } from 'react-native-safe-area-context';

<SafeAreaView edges={['bottom']}>
    ...
</SafeAreaView>

Test Plan

Use the latest code to run on web to se if edges are applied properly.

Copilot AI review requested due to automatic review settings January 11, 2026 18:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug in the web implementation of SafeAreaView where the edges parameter was not being respected correctly. When specific edges were provided (e.g., edges={['bottom']}), all edges were still receiving insets instead of only the specified ones.

Changes:

  • Reordered the switch cases in getEdgeValue function to make undefined edge modes default to 'off' behavior (no inset) instead of 'additive' behavior (applying inset)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant