fix: Disable interactions on minimal required subroot #3311
      
        
          +147
        
        
          −8
        
        
          
        
      
    
  
  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 #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.