Skip to content

Conversation

GSTJ
Copy link
Owner

@GSTJ GSTJ commented Apr 26, 2025

Description

This fixes a reported issue where modals were having intermittent rendering issues on iOS.

@michael-pingo-ai
Copy link

It could be that the navigation modal you're using doesn't require FullWindowOverlay to render the magic modal on top of it. Have you tried rendering the modal on top without FullWindowOverlay?

@michael-pingo-ai
Copy link

Here's my fix

useEffect(() => {
        if (modals.length > 0) {
          setHasOpenOrAnimatingModals(true);
        } else if (hasOpenOrAnimatingModals) {
          const timeout = setTimeout(() => {
            setHasOpenOrAnimatingModals(false);
          }, ANIMATION_DURATION_IN_MS);
          return () => clearTimeout(timeout);
        }
      }, [modals.length, hasOpenOrAnimatingModals]);

and

const Overlay = fullWindowOverlayEnabled && hasOpenOrAnimatingModals && Platform.OS === "ios" ? FullWindowOverlay : React.Fragment;

@GSTJ
Copy link
Owner Author

GSTJ commented Apr 26, 2025

@michael-pingo-ai It does require. Were you able to confirm that the fix in this PR was not enough and caused exit animation issues indeed?

Simulator.Screen.Recording.-.iPhone.16.Pro.Max.-.2025-04-26.at.15.42.31.mp4

@GSTJ
Copy link
Owner Author

GSTJ commented Apr 26, 2025

I'll work on something similar this weekend. I'd love to use animation callbacks instead of using effect, or at least consider the configurable exit animation time (config.animationOutTiming)

@GSTJ GSTJ changed the title [WIP]: Fix rendering issues on iOS [WIP] Fix rendering issues on iOS Apr 26, 2025
@michael-pingo-ai
Copy link

michael-pingo-ai commented Apr 26, 2025

Yeah that sounds like a better fix. Here's what I'm seeing when I try just using modals.length which seems like it should be expected behavior.

ScreenRecording_04-26-2025.13-46-40_1.MP4

@GSTJ
Copy link
Owner Author

GSTJ commented Apr 26, 2025

Noted!

I'd expect it indeed; unsure why it worked here. Thanks for hopping in and suggesting a fix

I'll let you know once I get to it. I hope you're temporarily unblocked using your patch.

@michael-pingo-ai
Copy link

Yes, we're unblocked with the patch. Thanks a lot for being so responsive!

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.

2 participants