@@ -457,6 +457,16 @@ const examples: Array<RNTesterModuleExample> = [
457
457
return < ClippingExampleHorizontal /> ;
458
458
} ,
459
459
} ,
460
+ {
461
+ name : 'touchableChildrenOverflowingContainerHorizontal' ,
462
+ title :
463
+ '<ScrollView> touchable children overflow content container (horizontal = true)\n' ,
464
+ description :
465
+ "Children that overflow ScrollView's content container should still receive touch events" ,
466
+ render ( ) {
467
+ return < ChildrenWithTouchEventsOverflowingContainerHorizontal /> ;
468
+ } ,
469
+ } ,
460
470
] ;
461
471
462
472
if ( Platform . OS === 'ios' ) {
@@ -1352,6 +1362,56 @@ function ClippingExampleHorizontal() {
1352
1362
) ;
1353
1363
}
1354
1364
1365
+ function TouchableItem ( { index} : { index : number } ) {
1366
+ const [ pressed , setPressed ] = useState ( false ) ;
1367
+
1368
+ return (
1369
+ < View
1370
+ onTouchStart = { ( ) => setPressed ( p => ! p ) }
1371
+ testID = { `touchable_item_${ index } ` }
1372
+ style = { {
1373
+ position : 'relative' ,
1374
+ flexDirection : 'row' ,
1375
+ justifyContent : 'center' ,
1376
+ alignItems : 'center' ,
1377
+ flexGrow : 1 ,
1378
+ flexShrink : 1 ,
1379
+ flexBasis : '25%' ,
1380
+ margin : 5 ,
1381
+ backgroundColor : pressed ? 'gray' : 'lightgray' ,
1382
+ } } >
1383
+ < Text > Item { index } </ Text >
1384
+ </ View >
1385
+ ) ;
1386
+ }
1387
+
1388
+ function ChildrenWithTouchEventsOverflowingContainerHorizontal ( ) {
1389
+ return (
1390
+ < ScrollView
1391
+ testID = "touchable_overflowing_container_horizontal"
1392
+ horizontal = { true }
1393
+ style = { [ styles . scrollView , { height : 200 , width : '100%' } ] }
1394
+ contentContainerStyle = { {
1395
+ backgroundColor : 'red' ,
1396
+ } }
1397
+ nestedScrollEnabled = { true } >
1398
+ < View
1399
+ style = { {
1400
+ display : 'flex' ,
1401
+ flexDirection : 'row' ,
1402
+ justifyContent : 'flex-start' ,
1403
+ alignItems : 'stretch' ,
1404
+ minHeight : 45 ,
1405
+ minWidth : '100%' ,
1406
+ } } >
1407
+ < TouchableItem index = { 1 } />
1408
+ < TouchableItem index = { 2 } />
1409
+ < TouchableItem index = { 3 } />
1410
+ </ View >
1411
+ </ ScrollView >
1412
+ ) ;
1413
+ }
1414
+
1355
1415
class Item extends React . PureComponent < {
1356
1416
msg ?: string ,
1357
1417
style ?: ViewStyleProp ,
0 commit comments