Skip to content

Commit 68dcc40

Browse files
committed
Add bubbling explainer
1 parent 3d6203f commit 68dcc40

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

packages/rn-tester/js/examples/KeyboardEventsExample/KeyboardEventsExample.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,20 @@ function BubblingExample(): React.Node {
8787

8888
return (
8989
<View style={{marginTop: 10}}>
90+
<View style={{marginBottom: 12, padding: 12, backgroundColor: '#f5f5f7', borderRadius: 8, borderWidth: 1, borderColor: '#e5e5e7'}}>
91+
<Text style={{fontSize: 14, fontWeight: '600', marginBottom: 6, color: '#1d1d1f'}}>
92+
Event Bubbling Behavior:
93+
</Text>
94+
<Text style={{fontSize: 12, marginBottom: 3, color: '#424245'}}>
95+
• Pressable won't bubble Space or Enter keys
96+
</Text>
97+
<Text style={{fontSize: 12, marginBottom: 3, color: '#424245'}}>
98+
• Keys 'f' and 'g' won't bubble past Box 2 (handled by keyDownEvents)
99+
</Text>
100+
<Text style={{fontSize: 12, color: '#424245'}}>
101+
• If "Stop Propagation" is enabled, no events bubble past 'f' and 'g' in JS
102+
</Text>
103+
</View>
90104
<View
91105
style={{flexDirection: 'row', alignItems: 'center', marginBottom: 8}}>
92106
<Text style={{marginRight: 8}}>Stop Propagation in Box 2:</Text>

0 commit comments

Comments
 (0)