Skip to content

Commit 0ba9d33

Browse files
committed
Fix popover height
1 parent dbecb70 commit 0ba9d33

3 files changed

Lines changed: 13 additions & 10 deletions

File tree

src/components/withKeyboardState.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ function KeyboardStateProvider({children}: ChildrenProps): ReactElement | null {
5050
const keyboardDidHideListener = KeyboardEvents.addListener('keyboardDidHide', () => {
5151
setKeyboardHeight(0);
5252
setIsKeyboardActive(false);
53+
// Sometimes 'keyboardWillHide' is not called (popover closed when keyboard is open), in this case we don't want stale keyboardActiveHeight value
54+
setKeyboardActiveHeight(0);
5355
});
5456
const keyboardWillShowListener = KeyboardEvents.addListener('keyboardWillShow', (e) => {
5557
setIsKeyboardActive(true);

src/hooks/useReportSubmitToPopover.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ function useReportSubmitToPopover({reportID, onSubmitSuccess, anchorAlignment =
265265
>
266266
<View
267267
collapsable={false}
268-
style={[StyleUtils.getHeight(submitToPopoverContentHeight), styles.flexColumn, styles.w100, styles.pt4]}
268+
style={[StyleUtils.getHeight(submitToPopoverContentHeight), styles.flexColumn, !isInLandscapeMode && styles.flex1, styles.w100, styles.pt4]}
269269
>
270270
<ReportSubmitToContent
271271
key={submitToContentKey}
@@ -282,27 +282,28 @@ function useReportSubmitToPopover({reportID, onSubmitSuccess, anchorAlignment =
282282
</PopoverWithMeasuredContent>
283283
);
284284
}, [
285-
StyleUtils,
286-
styles.flexColumn,
287-
styles.pt4,
288-
styles.w100,
285+
shouldRenderSubmitToPopover,
289286
innerContainerStyle,
290287
outerStyle,
291-
submitToPopoverContentHeight,
292-
shouldRenderSubmitToPopover,
293288
isVisible,
294289
closeReportSubmitToPopover,
295290
handleReportSubmitToPopoverModalHide,
296291
anchorPosition,
297292
anchorAlignment,
298-
anchorRef,
293+
StyleUtils,
294+
submitToPopoverContentHeight,
295+
styles.flexColumn,
296+
styles.flex1,
297+
styles.w100,
298+
styles.pt4,
299+
isInLandscapeMode,
300+
submitToContentKey,
299301
report,
300302
policy,
301303
isLoadingReportData,
302304
handleCombinedSubmitSuccess,
303305
isSearchSubmitFlow,
304306
handleSearchSubmitWithManagerEmail,
305-
submitToContentKey,
306307
]);
307308

308309
return {

src/pages/ReportSubmitToContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ function ReportSubmitToContent({
444444
isRowMultilineSupported
445445
style={{containerStyle: styles.flex1}}
446446
disableMaintainingScrollPosition
447-
addBottomSafeAreaPadding
447+
addBottomSafeAreaPadding={!isInLandscapeMode}
448448
>
449449
{hasError && (
450450
<FormHelpMessage

0 commit comments

Comments
 (0)