Skip to content
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

safe area not working on horizontal mode in IOS #32

Open
yashoda-esb opened this issue Jul 24, 2024 · 2 comments
Open

safe area not working on horizontal mode in IOS #32

yashoda-esb opened this issue Jul 24, 2024 · 2 comments

Comments

@yashoda-esb
Copy link

yashoda-esb commented Jul 24, 2024

Here is the code:

        await SafeArea.addListener('safeAreaChanged', (data:any) => {
            const { insets } = data;
            for (const [key, value] of Object.entries(insets)) {
                document.documentElement.style.setProperty(
                    `--safe-area-inset-${key}`,
                    `${value}px`,
                );
            }
        });
@AlwaysLoveme
Copy link
Owner

SafeArea.addListener

What model is your device?

@yashoda-esb
Copy link
Author

SafeArea.addListener

What model is your device?

I've tested on an iPhone 15 Pro Max and an iPhone 12. In horizontal mode, the top value is always 0, while in vertical mode, the top value adjusts correctly based on the status bar. However, in horizontal mode, the values for top, left, right, and bottom are not accurate. Additionally, when changing orientation from vertical to horizontal, a black section appears at the top of the screen, and the status bar is not visible in horizontal mode on both devices. Here is an image showing the issue. on Android its working fine .

black-section-on-top-statusbar

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

No branches or pull requests

2 participants