Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate children of GestureDetector to check if there is only one native view that can be a target of the gestures #2132

Merged
merged 1 commit into from
Jul 19, 2022

Conversation

j-piasecki
Copy link
Member

@j-piasecki j-piasecki commented Jul 19, 2022

Description

This PR adds a validation step during rendering of GestureDetector that traverses the Fiber tree to check if there is more that one view that could be a candidate to become the gesture target. If there are more the error message will be displayed.
For example, this is not ok:

graph TD;
    Wrap-->NativeView1;
    Wrap-->NativeView2;

but this is fine:

graph TD;
    Wrap-->NativeView1;
    NativeView1-->NativeView2;
    NativeView1-->NativeView3;

Test plan

Tested on the Example app.

@j-piasecki j-piasecki requested a review from tomekzaw July 19, 2022 12:56
Copy link
Member

@tomekzaw tomekzaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@j-piasecki j-piasecki merged commit b761918 into main Jul 19, 2022
@j-piasecki j-piasecki deleted the @jpiasecki/validate-detector-children branch July 19, 2022 13:33
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.

None yet

2 participants