-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Fix date filter is cut off #88704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix date filter is cut off #88704
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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]}> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please also add test case for this
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
| <HeaderWithBackButton | ||
| shouldDisplayHelpButton={false} | ||
| style={[styles.h10]} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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'; | ||
|
|
@@ -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]; | ||
|
|
@@ -40,7 +34,6 @@ function DatePickerFilterPopup({closeOverlay, setPopoverWidth, filterKey, value, | |
| closeOverlay={closeOverlay} | ||
| setPopoverWidth={setPopoverWidth} | ||
| presets={getDatePresets(filterKey, true)} | ||
| style={[styles.getPopoverMaxHeight(windowHeight, isInLandscapeMode)]} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
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. |
||
| /> | ||
|
bernhardoj marked this conversation as resolved.
|
||
| ); | ||
| } | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.