Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,10 @@ function ReportFieldListPopup({value, field, onBackButtonPress, onChange}: Repor

function ReportFieldDatePopup({value, field, onBackButtonPress, onChange}: ReportFieldDatePopupProps) {
const styles = useThemeStyles();
const {windowHeight} = useWindowDimensions();
const isInLandscapeMode = useIsInLandscapeMode();
const filterKey = `${CONST.SEARCH.REPORT_FIELD.DEFAULT_PREFIX}${getFieldNameAsKey(field.name)}` as const;

return (
<View style={[styles.pv4, styles.gap2, styles.getPopoverMaxHeight(windowHeight, isInLandscapeMode)]}>
<View style={[styles.pv4, styles.gap2]}>
Comment thread
bernhardoj marked this conversation as resolved.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add test case for this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

<HeaderWithBackButton
shouldDisplayHelpButton={false}
style={[styles.h10]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import React from 'react';
import DateSelectPopup from '@components/Search/FilterDropdowns/DateSelectPopup';
import type {PopoverComponentProps} from '@components/Search/FilterDropdowns/DropdownButton';
import type {SearchDateFilterKeys} from '@components/Search/types';
import useIsInLandscapeMode from '@hooks/useIsInLandscapeMode';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import useWindowDimensions from '@hooks/useWindowDimensions';
import type {SearchDateValues} from '@libs/SearchQueryUtils';
import {getDatePresets} from '@libs/SearchUIUtils';
import CONST from '@src/CONST';
Expand All @@ -21,9 +18,6 @@ type DatePickerFilterPopupProps = PopoverComponentProps & {

function DatePickerFilterPopup({closeOverlay, setPopoverWidth, filterKey, value, translationKey, updateFilterForm}: DatePickerFilterPopupProps) {
const {translate} = useLocalize();
const styles = useThemeStyles();
const {windowHeight} = useWindowDimensions();
const isInLandscapeMode = useIsInLandscapeMode();
const onChange = (selectedDates: SearchDateValues) => {
const dateFormValues: Record<string, string | undefined> = {};
dateFormValues[`${filterKey}On`] = selectedDates[CONST.SEARCH.DATE_MODIFIERS.ON];
Expand All @@ -40,7 +34,6 @@ function DatePickerFilterPopup({closeOverlay, setPopoverWidth, filterKey, value,
closeOverlay={closeOverlay}
setPopoverWidth={setPopoverWidth}
presets={getDatePresets(filterKey, true)}
style={[styles.getPopoverMaxHeight(windowHeight, isInLandscapeMode)]}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still need max height and make it scrollable instead.

On resized window:

Image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added back the max height style that was removed in https://github.com/Expensify/App/pull/88191/changes#diff-83cb90c4b04d8b728f53bc1ee7a2400a965b1148a1f4645cec08033cee26d83f, but instead of only applying it when date range modifier is selected, we now apply it to all cases, and also change the View to ScrollView in large screen to make it scrollable.

Note: DateSelectPopup is also used for date-type report field and the max height doesn't work fine

image

But I think it's fine, no real user will resize their window to be that small. In #88428, the report field date will follow the same max-height as the report field list and other popups.

/>
Comment thread
bernhardoj marked this conversation as resolved.
);
}
Expand Down
Loading