File tree 3 files changed +12
-0
lines changed
3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,7 @@ function BaseSelectionList<TItem extends ListItem>(
129
129
shouldDebounceScrolling = false ,
130
130
shouldPreventActiveCellVirtualization = false ,
131
131
shouldScrollToFocusedIndex = true ,
132
+ isSmallScreenWidth,
132
133
onContentSizeChange,
133
134
listItemTitleStyles,
134
135
initialNumToRender = 12 ,
@@ -413,6 +414,11 @@ function BaseSelectionList<TItem extends ListItem>(
413
414
414
415
if ( shouldShowTextInput ) {
415
416
clearInputAfterSelect ( ) ;
417
+ } else if ( isSmallScreenWidth ) {
418
+ if ( ! item . isDisabledCheckbox ) {
419
+ onCheckboxPress ?.( item ) ;
420
+ }
421
+ return ;
416
422
}
417
423
}
418
424
@@ -438,6 +444,8 @@ function BaseSelectionList<TItem extends ListItem>(
438
444
shouldPreventDefaultFocusOnSelectRow ,
439
445
isFocused ,
440
446
isScreenFocused ,
447
+ isSmallScreenWidth ,
448
+ onCheckboxPress ,
441
449
] ,
442
450
) ;
443
451
Original file line number Diff line number Diff line change @@ -716,6 +716,9 @@ type SelectionListProps<TItem extends ListItem> = Partial<ChildrenProps> & {
716
716
/** Whether to scroll to the focused index */
717
717
shouldScrollToFocusedIndex ?: boolean ;
718
718
719
+ /** Whether the layout is narrow */
720
+ isSmallScreenWidth ?: boolean ;
721
+
719
722
/** Called when scrollable content view of the ScrollView changes */
720
723
onContentSizeChange ?: ( w : number , h : number ) => void ;
721
724
Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ function SelectionListWithModal<TItem extends ListItem>(
115
115
sections = { sections }
116
116
onLongPressRow = { handleLongPressRow }
117
117
isScreenFocused = { isScreenFocused }
118
+ isSmallScreenWidth = { isSmallScreenWidth }
118
119
// eslint-disable-next-line react/jsx-props-no-spreading
119
120
{ ...rest }
120
121
/>
You can’t perform that action at this time.
0 commit comments