Skip to content

Instantly share code, notes, and snippets.

@NickIliev
Created August 14, 2019 11:26
Show Gist options
  • Save NickIliev/c290bed8552148d17555add0fde2661d to your computer and use it in GitHub Desktop.
Save NickIliev/c290bed8552148d17555add0fde2661d to your computer and use it in GitHub Desktop.
Event propagation (bubbling) in NativeScript
<GridLayout id="outmost" margin="10" backgroundColor="orangered" tap="onTap" >
<GridLayout id="middle" margin="50" backgroundColor="lightgray" tap="onTap">
<GridLayout id="inner" margin="50" backgroundColor="blue" tap="onTap"> <!-- The StackLayout will propagete the tap gesture to its parents -->
<Button text="Button" id="my-button" width="100" height="200" tap="onTap" backgroundColor="whitesmoke" /> <!-- The Button has its own tap logic and won't propagate the tap event -->
</GridLayout>
</GridLayout>
</GridLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment