Skip to content

OnLayout not returning position with respect to screen #15535

Closed
@James2516

Description

@James2516

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

  1. react-native -v:
    react-native-cli: 2.0.1
    react-native: 0.45.1
  2. node -v: v6.11.0
  3. npm -v: 3.10.10

Then, specify:

  • Target Platform: Android
  • Development Operating System: Windows
  • Build tools:

Steps to Reproduce

(Write your steps here:)

I need to detect if component A's position is within component B when pan gesture (drag) on A is released. However, the position from onPanResponderRelease's gesture.moveY is measured with respect to the entire screen, whereas the position returned from A's onLayoutis measured with respect to the parent view. So i'd need to know the parent view's current height to reconcile the differences.

Expected Behavior

There should be a function to return the position with respect to the entire screen.

Actual Behavior

see above

Reproducible Demo

see above

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions