Skip to content

[Navigator] Components of inactive Navigator scenes intercepting touch events #1401

Closed

Description

@ide

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.

Activity

  1. changed the title [-]Components of inactive Navigator scenes intercepting touch events[/-] [+][Navigator] Components of inactive Navigator scenes intercepting touch events[/+] on May 29, 2015
  2. PhilippKrone commented on Jul 22, 2015

    @PhilippKrone
    Contributor

    @ide Do you have any update here? I have the same at the moment:

    • initialRouteStack with multiple scenes in it
    • inactive scenes are intercepting touch events

    I dont really know what you mean with "opacity:0" here - should I set it dynamically on all inactive scenes?

  3. ide commented on Jul 22, 2015

    @ide
    ContributorAuthor

    I dont really know what you mean with "opacity:0" here - should I set it dynamically on all inactive scenes?

    Yes but this works only on iOS.

  4. PhilippKrone commented on Jul 22, 2015

    @PhilippKrone
    Contributor

    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?

  5. ide commented on Jul 22, 2015

    @ide
    ContributorAuthor

    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.

  6. ide commented on Jul 22, 2015

    @ide
    ContributorAuthor

    Another approach is to use initialRoute instead of initialRouteStack.

  7. PhilippKrone commented on Jul 22, 2015

    @PhilippKrone
    Contributor

    Adding

                removeClippedSubviews={true}

    worked. I'll create a PR for that, or do you see any disadvantage here?

  8. ide commented on Jul 22, 2015

    @ide
    ContributorAuthor

    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.

  9. added a commit that references this issue on Jul 27, 2015
    bf7e2a8
  10. locked as resolved and limited conversation to collaborators on Jul 22, 2018
  11. added
    Resolution: Locked
    on Jul 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution: Locked

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions