Skip to content

Commit

Permalink
Remove extra padding above the button on ios
Browse files Browse the repository at this point in the history
  • Loading branch information
VickyStash committed Nov 8, 2024
1 parent 8082a9a commit a9bdbe2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/SelectionList/BaseSelectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ function BaseSelectionList<TItem extends ListItem>(
sectionTitleStyles,
textInputAutoFocus = true,
shouldShowTextInputAfterHeader = false,
includeSafeAreaPaddingBottom = true,
shouldTextInputInterceptSwipe = false,
listHeaderContent,
onEndReached = () => {},
Expand Down Expand Up @@ -719,7 +720,7 @@ function BaseSelectionList<TItem extends ListItem>(
return (
<SafeAreaConsumer>
{({safeAreaPaddingBottomStyle}) => (
<View style={[styles.flex1, (!isKeyboardShown || !!footerContent || showConfirmButton) && safeAreaPaddingBottomStyle, containerStyle]}>
<View style={[styles.flex1, (!isKeyboardShown || !!footerContent || showConfirmButton) && includeSafeAreaPaddingBottom && safeAreaPaddingBottomStyle, containerStyle]}>
{shouldShowTextInput && !shouldShowTextInputAfterHeader && renderInput()}
{/* If we are loading new options we will avoid showing any header message. This is mostly because one of the header messages says there are no options. */}
{/* This is misleading because we might be in the process of loading fresh options from the server. */}
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 @@ -446,6 +446,9 @@ type BaseSelectionListProps<TItem extends ListItem> = Partial<ChildrenProps> & {
/** Whether the text input should be shown after list header */
shouldShowTextInputAfterHeader?: boolean;

/** Whether to include padding bottom */
includeSafeAreaPaddingBottom?: boolean;

/** Callback to fire when the list is scrolled */
onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ function CardSelectionStep({feed, policyID}: CardSelectionStepProps) {
</View>
}
shouldShowTextInputAfterHeader
includeSafeAreaPaddingBottom={false}
shouldShowListEmptyContent={false}
shouldUpdateFocusedIndex
/>
Expand Down

0 comments on commit a9bdbe2

Please sign in to comment.