Skip to content

onLayout prop is missing x,y in callback's e.nativeEvent.layout #26

@fungilation

Description

@fungilation

I'm dropping in Tooltip as a replacement for my existing components, iterated as rows inside a listview over a data array. For example, a row:

<ToolTip onLayout={(e) => console.log(index, `Summary ${rowID} onLayout:`, e.nativeEvent.layout)}>
  <Text ...>
</ToolTip>

console logs would return for each row, e.nativeEvent.layout.width and .height as expected. .x and .y however always return 0, while TouchableHighlight returns the x,y coordinates of the rendered component as documented (React Native).

Is this a bug that e.nativeEvent.layout is not fully inherited from TouchableHighlight, or rather, the parent touchablewithoutfeedback?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions