Skip to content

Commit

Permalink
Fix SearchRouter submit not working on Search Page
Browse files Browse the repository at this point in the history
  • Loading branch information
Kicu committed Sep 19, 2024
1 parent 8b099ff commit 584ac31
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 2 additions & 0 deletions src/components/SelectionList/BaseSelectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function BaseSelectionList<TItem extends ListItem>(
disableKeyboardShortcuts = false,
children,
shouldStopPropagation = false,
shouldPreventDefault = true,
shouldShowTooltips = true,
shouldUseDynamicMaxToRenderPerBatch = false,
rightHandSideComponent,
Expand Down Expand Up @@ -623,6 +624,7 @@ function BaseSelectionList<TItem extends ListItem>(
captureOnInputs: true,
shouldBubble: !flattenedSections.allOptions[focusedIndex],
shouldStopPropagation,
shouldPreventDefault,
isActive: !disableKeyboardShortcuts && !disableEnterShortcut && isFocused,
});

Expand Down
5 changes: 4 additions & 1 deletion src/components/SelectionList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,12 @@ type BaseSelectionListProps<TItem extends ListItem> = Partial<ChildrenProps> & {
/** 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;

Expand Down

0 comments on commit 584ac31

Please sign in to comment.