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
4 changes: 3 additions & 1 deletion src/components/Search/FilterDropdowns/ActionButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ type ActionButtonsProps = {
containerStyle: React.ComponentProps<typeof View>['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();

Expand All @@ -39,6 +40,7 @@ function ActionButtons({containerStyle, resetSentryLabel, applySentryLabel, onRe
onPress={onApply}
sentryLabel={applySentryLabel}
>
{!!shouldSubmitOnEnter && <Button.KeyboardShortcut />}
<Button.Text>{translate('common.apply')}</Button.Text>
</Button>
</View>
Expand Down
1 change: 1 addition & 0 deletions src/components/Search/FilterDropdowns/AmountPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
>
<AmountWithoutCurrencyInput
containerStyles={[styles.ph4, styles.mb2]}
Expand Down
16 changes: 15 additions & 1 deletion src/components/Search/FilterDropdowns/BasePopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,25 @@ type BasePopupProps = React.PropsWithChildren & {
applySentryLabel: string;
resetSentryLabel?: string;
style?: StyleProp<ViewStyle>;
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();
Expand All @@ -50,6 +63,7 @@ function BasePopup({children, label, applySentryLabel, resetSentryLabel, showLab
onApply={onApply}
applySentryLabel={applySentryLabel}
resetSentryLabel={resetSentryLabel}
shouldSubmitOnEnter={shouldSubmitOnEnter}
/>
)}
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
>
<ReportFieldBase
ref={reportFieldRef}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ function TextFilterPopup({baseFilterKey, values, label, updateFilterForm, closeO
label={label}
onApply={applyChanges}
applySentryLabel={`Search-FilterPopupApply-${baseFilterKey}`}
shouldSubmitOnEnter
>
<NegatableFilter
baseFilterKey={baseFilterKey}
Expand Down
1 change: 1 addition & 0 deletions src/components/Search/FilterDropdowns/TextInputPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function TextInputPopup({style, defaultValue, label, placeholder, onBackButtonPr
onBackButtonPress={onBackButtonPress}
resetSentryLabel={CONST.SENTRY_LABEL.SEARCH.FILTER_POPUP_RESET_TEXT_INPUT}
applySentryLabel={CONST.SENTRY_LABEL.SEARCH.FILTER_POPUP_APPLY_TEXT_INPUT}
shouldSubmitOnEnter
style={style}
>
<TextInput
Expand Down
Loading