Skip to content

Conversation

@kmichalikk
Copy link
Collaborator

@kmichalikk kmichalikk commented Oct 20, 2025

Description

Fixes #3307

This PR changes the logic for setting userInteractionsEnabled = false for 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 = false on 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.

@kmichalikk kmichalikk marked this pull request as draft October 20, 2025 11:18
@kmichalikk kmichalikk force-pushed the @kmichalikk/bottom-tabs-interactive-disabled-3307 branch from 442e03e to a2526cd Compare October 20, 2025 16:26
@kmichalikk kmichalikk requested review from kkafar, kligarski and t0maboro and removed request for kligarski October 21, 2025 08:09
@kmichalikk kmichalikk self-assigned this Oct 21, 2025
@kmichalikk kmichalikk requested a review from kligarski October 21, 2025 08:10
@kmichalikk kmichalikk marked this pull request as ready for review October 21, 2025 08:10
@kmichalikk kmichalikk force-pushed the @kmichalikk/bottom-tabs-interactive-disabled-3307 branch from c7cb4e7 to 8403629 Compare October 22, 2025 06:46
@kmichalikk kmichalikk marked this pull request as draft October 22, 2025 07:14
@kmichalikk kmichalikk force-pushed the @kmichalikk/bottom-tabs-interactive-disabled-3307 branch from 8403629 to 128773d Compare October 23, 2025 10:11
@kmichalikk kmichalikk marked this pull request as ready for review October 23, 2025 10:19
@kmichalikk kmichalikk force-pushed the @kmichalikk/bottom-tabs-interactive-disabled-3307 branch from 128773d to e0b5784 Compare October 29, 2025 09:54
@kmichalikk kmichalikk requested a review from t0maboro October 29, 2025 09:57
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.

react-native-bottom-tabs got slower from 4.16.x to 4.17.x

4 participants