[iOS] Fix user interaction never being reenabled when cancelling a video fullscreen dismiss gesture #3389
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes #3388
In #3173, interaction is disabled during screen transitions. However, when using the native fullscreen video player from
expo-video, there is an edge case - you can cancel your swipe gesture, which causes user interaction to be disabled and never reenabled. The order of events is this:willMoveToWindowfires, disabling user interactionwillMoveToWindowagain, as we're moving back to the video playerviewDidAppeardoes not fire, because nothing actually changedTherefore user interaction is never reenabled, even though the transition is over
Changes
Caution
This was vibecoded. I have done my best to verify the code.
My fix is to track the current window, and in
didMoveToWindowcheck if the movement is fromnilto a window, reenabling user interaction if so. This appears to cover the dismiss case.I am no expert here and I don't trust Claude, so please correct me if I'm wrong, there's a good chance I am. However, this does appear to fix the issue both in my minimal repro and in the main app.
Screenshots / GIFs
Before
Screen.Recording.2025-11-11.at.13.04.31-compressed.mp4
After
Screen.Recording.2025-11-11.at.15.20.49-compressed.mp4
Test code and steps to reproduce
My repro is here: https://github.com/mozzius/screens-video-repro/tree/samuel/patch-fix
I patched in this change in this branch, so you can see the fix working: https://github.com/mozzius/screens-video-repro/tree/samuel/patch-fix
Checklist