-
-
Notifications
You must be signed in to change notification settings - Fork 597
fix: Disable interactions on minimal required subroot #3311
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
fix: Disable interactions on minimal required subroot #3311
Conversation
442e03e to
a2526cd
Compare
c7cb4e7 to
8403629
Compare
8403629 to
128773d
Compare
128773d to
e0b5784
Compare
|
Is there any ETA for this to be merged 👀 |
kkafar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks sensible. I did some manual testing & it seems that "regular" scenarios are working fine.
@KrzysztofWojnar could I add this to your backlog? Would be nice to test this on more "complex" navigation scenarios (modals & push interlaced, tabs, split, etc.)
Description
Fixes #3307
This PR changes the logic for setting
userInteractionsEnabled = falsefor the time of screen transitions. Currently, when transition happens, the whole UIWindow gets disabled. This included the time when the whole stack is detached from the window, for instance, when changing the tab in BottomTabs. This unnecessarily removes the ability to click through tabs for the time of the transition. Moreover, in some cases on hot reload, the call to disable the interactions is not matched with re-enabling them. This PR fixes both issues by introducing a helper class with one instance shared across screens, that finds an appropriate view to disable, and stores a reference to it, to make sure the correct one is re-enabled.The final attempt disables interaction for RNSScreenStack's first subview, which wraps navigation header and screen content, and adds a temporary gesture recognizer for RNSScreenStackView which captures swipe gestures and does nothing so the gestures are not propagated further (for instance, to outer stack when one is nested in another, which would result in the whole stack being dismissed if user happens to swipe again mid transition).
Changes
Set
userInteractionsEnabled = falseon RNSScreenStack subview. Temporarily add UIPanGestureRecognizer to sink all gesture event.Test code and steps to reproduce
Use BottomTabsTest to verify that BottomTabs can be clicked through, and Test3093 to verify that the logic for stack doesn't change.