You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Navigator] Components of inactive Navigator scenes intercepting touch events #1401
With master (0.5.0-rc) I occasionally encountered touch events being received by components in a scene that's not visible but is in my initial route stack. The initial route stack has two scenes, the bottom scene and top scene. The initial route is the bottom scene's.
Some touches in the bottom scene are sent to the components in the top scene, even though the top scene isn't active. That is, the bottom scene is still visible and has focus. The top scene has never been pushed/jumped to.
Looking at the UIView hierarchy, the root of the top scene is 0px wide and 667px tall and its children are not clipped. If it makes sense for the Navigator to mount scenes that aren't active, it might make sense to implement visibility: hidden (#1322) so that only the shadow views are created. In the meantime, opacity: 0 seems to stop intercepting the touch events.
changed the title [-]Components of inactive Navigator scenes intercepting touch events[/-][+][Navigator] Components of inactive Navigator scenes intercepting touch events[/+]on May 29, 2015
But thats not really a good solution, is it? Gives a lot of non-functional code for something which sounds like a bug for me. Can you give me a hint how to tackle this issue by creating a PR?
It's not a great solution which is why I only use it in my own copy of react native. The problem is that navigator hides scenes using overflow:hidden on a zero-width element but the overflowing elements still receive touches. There's also that prop to clip overflowed subviews that might work as well though I haven't tried it. If you discover a good approach you could submit a PR.
Activity
[-]Components of inactive Navigator scenes intercepting touch events[/-][+][Navigator] Components of inactive Navigator scenes intercepting touch events[/+]PhilippKrone commentedon Jul 22, 2015
@ide Do you have any update here? I have the same at the moment:
I dont really know what you mean with "opacity:0" here - should I set it dynamically on all inactive scenes?
ide commentedon Jul 22, 2015
Yes but this works only on iOS.
PhilippKrone commentedon Jul 22, 2015
But thats not really a good solution, is it? Gives a lot of non-functional code for something which sounds like a bug for me. Can you give me a hint how to tackle this issue by creating a PR?
ide commentedon Jul 22, 2015
It's not a great solution which is why I only use it in my own copy of react native. The problem is that navigator hides scenes using overflow:hidden on a zero-width element but the overflowing elements still receive touches. There's also that prop to clip overflowed subviews that might work as well though I haven't tried it. If you discover a good approach you could submit a PR.
ide commentedon Jul 22, 2015
Another approach is to use initialRoute instead of initialRouteStack.
PhilippKrone commentedon Jul 22, 2015
Adding
worked. I'll create a PR for that, or do you see any disadvantage here?
ide commentedon Jul 22, 2015
I would send the PR and then the engineers at FB working on navigator could take a look at it. It seems like a good approach to me though.
[Navigator] Vertically hide disabled scenes and use pointerEvents="none"