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

React Native SafeAreaView causes modal to show background #445

Closed
3 tasks done
btraut opened this issue Feb 3, 2023 · 3 comments
Closed
3 tasks done

React Native SafeAreaView causes modal to show background #445

btraut opened this issue Feb 3, 2023 · 3 comments

Comments

@btraut
Copy link

btraut commented Feb 3, 2023

βœ… Prerequisites

  • Did you perform a cursory search of open issues? Is this bug already reported elsewhere?
  • Are you running the latest SDK version?
  • Are you reporting to the correct repository (magic-sdk)?

πŸ› Description

PR #431 (released in v14.0.0) introduced SafeAreaView which is great for fixing issues where the close button would overlap the iOS status bar, but it caused the Magic web view to no longer be full screen. This causes the open animation (web view with drop shadow grows from center and fades in) to stop animating before it reaches full screen. Furthermore, it exposes and other screen background behind the web view.

Example:

CleanShot 2023-02-02 at 17 14 27

🧩 Steps to Reproduce

  1. Set a background color other than the Magic login screen (light or dark) for the full screen.
  2. Trigger magic login.

πŸ€” Expected behavior

The Magic Relayer should be full screen, but it should contain a that wraps the web view inside. The background color needs to belong to the outer view.

🌎 Environment

Software Version(s)
react-native-expo 14.0.0
@btraut
Copy link
Author

btraut commented Feb 3, 2023

I managed to hack my way a little deeper into this problem by overriding the Relayer component that @magic-sdk/react-native-expo uses, and I managed to extend the component to the edges of the screen.

The new problem is that the background color, drop shadow, and zoom transition all belong to the page being loaded in the web view. Is there any way to turn these things off? They all look bad because they don't zoom to fill the screen (they only fill the webview which is inset due to SafeAreaView).

@btraut
Copy link
Author

btraut commented Feb 3, 2023

I hacked even further, but I'm at an impasse. As it turns out, WebView lets you inject JS, so I'm able to create a stylesheet and modify styles of the box.magic.link page. I thought this would allow me to turn off the transitions, but unfortunately they belong to a further iframe for auth.magic.link which appears to be a React app that renders the box. Since it's a cross-domain iframe request, I'm unable to inject scripts into that page. Is there any way to make the request to auth.magic.link to tell it to disable the transitions (perhaps a "prefers-reduced-motion" flag)?

@Ariflo
Copy link
Contributor

Ariflo commented Feb 3, 2023

@btraut thanks for bringing this to our attention. We are investigating a solution and will get back to you as soon as we can.

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

No branches or pull requests

3 participants