Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/components/SelectionList/BaseSelectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ function BaseSelectionList<TItem extends ListItem>(
shouldDebounceScrolling = false,
shouldPreventActiveCellVirtualization = false,
shouldScrollToFocusedIndex = true,
isSmallScreenWidth,
onContentSizeChange,
listItemTitleStyles,
initialNumToRender = 12,
Expand Down Expand Up @@ -412,6 +413,9 @@ function BaseSelectionList<TItem extends ListItem>(

if (shouldShowTextInput) {
clearInputAfterSelect();
} else if (isSmallScreenWidth) {
onCheckboxPress?.(item);
return;
}
}

Expand All @@ -437,6 +441,8 @@ function BaseSelectionList<TItem extends ListItem>(
shouldPreventDefaultFocusOnSelectRow,
isFocused,
isScreenFocused,
isSmallScreenWidth,
onCheckboxPress,
],
);

Expand Down
3 changes: 3 additions & 0 deletions src/components/SelectionList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,9 @@ type SelectionListProps<TItem extends ListItem> = Partial<ChildrenProps> & {
/** Whether focus event should be delayed */
shouldDelayFocus?: boolean;

/** Whether the layout is narrow */
isSmallScreenWidth?: boolean;

/** Callback to fire when the text input changes */
onArrowFocus?: (focusedItem: TItem) => void;

Expand Down
1 change: 1 addition & 0 deletions src/components/SelectionListWithModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ function SelectionListWithModal<TItem extends ListItem>(
sections={sections}
onLongPressRow={handleLongPressRow}
isScreenFocused={isScreenFocused}
isSmallScreenWidth={isSmallScreenWidth}
// eslint-disable-next-line react/jsx-props-no-spreading
{...rest}
/>
Expand Down