diff --git a/src/components/Search/FilterDropdowns/ActionButtons.tsx b/src/components/Search/FilterDropdowns/ActionButtons.tsx index 76936bc330d7..5230c3cad6fc 100644 --- a/src/components/Search/FilterDropdowns/ActionButtons.tsx +++ b/src/components/Search/FilterDropdowns/ActionButtons.tsx @@ -12,11 +12,12 @@ type ActionButtonsProps = { containerStyle: React.ComponentProps['style']; resetSentryLabel?: string; applySentryLabel?: string; + shouldSubmitOnEnter?: boolean; onReset?: () => void; onApply: () => void; }; -function ActionButtons({containerStyle, resetSentryLabel, applySentryLabel, onReset, onApply}: ActionButtonsProps) { +function ActionButtons({containerStyle, resetSentryLabel, applySentryLabel, shouldSubmitOnEnter, onReset, onApply}: ActionButtonsProps) { const styles = useThemeStyles(); const {translate} = useLocalize(); @@ -39,6 +40,7 @@ function ActionButtons({containerStyle, resetSentryLabel, applySentryLabel, onRe onPress={onApply} sentryLabel={applySentryLabel} > + {!!shouldSubmitOnEnter && } {translate('common.apply')} diff --git a/src/components/Search/FilterDropdowns/AmountPopup.tsx b/src/components/Search/FilterDropdowns/AmountPopup.tsx index 9dd35292c8b0..3527f1f904eb 100644 --- a/src/components/Search/FilterDropdowns/AmountPopup.tsx +++ b/src/components/Search/FilterDropdowns/AmountPopup.tsx @@ -42,6 +42,7 @@ function AmountInput({title, value, name, onSave, onBackButtonPress}: AmountInpu onApply={() => onSave(amount)} applySentryLabel={CONST.SENTRY_LABEL.SEARCH.FILTER_POPUP_APPLY_AMOUNT} onBackButtonPress={onBackButtonPress} + shouldSubmitOnEnter > ; + shouldSubmitOnEnter?: boolean; onApply: () => void; onReset?: () => void; onBackButtonPress?: () => void; }; -function BasePopup({children, label, applySentryLabel, resetSentryLabel, showLabel, shouldShowActionButtons = true, style, onApply, onReset, onBackButtonPress}: BasePopupProps) { +function BasePopup({ + children, + label, + applySentryLabel, + resetSentryLabel, + showLabel, + shouldShowActionButtons = true, + shouldSubmitOnEnter, + style, + onApply, + onReset, + onBackButtonPress, +}: BasePopupProps) { // eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth const {isSmallScreenWidth} = useResponsiveLayout(); const styles = useThemeStyles(); @@ -50,6 +63,7 @@ function BasePopup({children, label, applySentryLabel, resetSentryLabel, showLab onApply={onApply} applySentryLabel={applySentryLabel} resetSentryLabel={resetSentryLabel} + shouldSubmitOnEnter={shouldSubmitOnEnter} /> )} diff --git a/src/components/Search/FilterDropdowns/ReportFieldPopup.tsx b/src/components/Search/FilterDropdowns/ReportFieldPopup.tsx index 7afd44d67218..162e0fbec977 100644 --- a/src/components/Search/FilterDropdowns/ReportFieldPopup.tsx +++ b/src/components/Search/FilterDropdowns/ReportFieldPopup.tsx @@ -50,6 +50,7 @@ function ReportFieldPopup({values, closeOverlay, updateFilterForm}: ReportFieldP onApply={applyChanges} applySentryLabel={CONST.SENTRY_LABEL.SEARCH.FILTER_POPUP_APPLY_REPORT_FIELD} style={[styles.getPopoverMaxHeight(windowHeight, isInLandscapeMode)]} + shouldSubmitOnEnter={selectedField?.type === CONST.REPORT_FIELD_TYPES.TEXT} >