diff --git a/src/components/Search/index.tsx b/src/components/Search/index.tsx index 4e23c0883f84..d1080da19932 100644 --- a/src/components/Search/index.tsx +++ b/src/components/Search/index.tsx @@ -389,6 +389,7 @@ function Search({queryJSON}: SearchProps) { getItemHeight={getItemHeightMemoized} shouldSingleExecuteRowSelect shouldPreventDefaultFocusOnSelectRow={!DeviceCapabilities.canUseTouchScreen()} + shouldPreventDefault={false} listHeaderWrapperStyle={[styles.ph8, styles.pv3, styles.pb5]} containerStyle={[styles.pv0]} showScrollIndicator={false} diff --git a/src/components/SelectionList/BaseSelectionList.tsx b/src/components/SelectionList/BaseSelectionList.tsx index 9ee264bc9bf9..197c64b99a26 100644 --- a/src/components/SelectionList/BaseSelectionList.tsx +++ b/src/components/SelectionList/BaseSelectionList.tsx @@ -71,6 +71,7 @@ function BaseSelectionList( disableKeyboardShortcuts = false, children, shouldStopPropagation = false, + shouldPreventDefault = true, shouldShowTooltips = true, shouldUseDynamicMaxToRenderPerBatch = false, rightHandSideComponent, @@ -623,6 +624,7 @@ function BaseSelectionList( captureOnInputs: true, shouldBubble: !flattenedSections.allOptions[focusedIndex], shouldStopPropagation, + shouldPreventDefault, isActive: !disableKeyboardShortcuts && !disableEnterShortcut && isFocused, }); diff --git a/src/components/SelectionList/types.ts b/src/components/SelectionList/types.ts index c1085c71e0f6..14c83ef25ed4 100644 --- a/src/components/SelectionList/types.ts +++ b/src/components/SelectionList/types.ts @@ -436,9 +436,12 @@ type BaseSelectionListProps = Partial & { /** Whether tooltips should be shown */ shouldShowTooltips?: boolean; - /** Whether to stop automatic form submission on pressing enter key or not */ + /** Whether to stop automatic propagation on pressing enter key or not */ shouldStopPropagation?: boolean; + /** Whether to call preventDefault() on pressing enter key or not */ + shouldPreventDefault?: boolean; + /** Whether to prevent default focusing of options and focus the textinput when selecting an option */ shouldPreventDefaultFocusOnSelectRow?: boolean;