@@ -16,6 +16,7 @@ import usePrevious from './usePrevious';
1616import useResponsiveLayout from './useResponsiveLayout' ;
1717import useStyleUtils from './useStyleUtils' ;
1818import useThemeStyles from './useThemeStyles' ;
19+ import useViewportOffsetTop from './useViewportOffsetTop' ;
1920import useWindowDimensions from './useWindowDimensions' ;
2021
2122const popoverDimensions = {
@@ -47,6 +48,7 @@ function useReportSubmitToPopover({reportID, onSubmitSuccess, anchorAlignment =
4748 const styles = useThemeStyles ( ) ;
4849 const StyleUtils = useStyleUtils ( ) ;
4950 const { windowHeight} = useWindowDimensions ( ) ;
51+ const viewportOffsetTop = useViewportOffsetTop ( ) ;
5052 const isInLandscapeMode = useIsInLandscapeMode ( ) ;
5153 // Bottom-docked Modal path only; aligns with Popover path that omits modal shell padding chrome
5254 // eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
@@ -194,12 +196,22 @@ function useReportSubmitToPopover({reportID, onSubmitSuccess, anchorAlignment =
194196 [ reportID , willAlertModalBecomeVisible , showReportSubmitToPopover ] ,
195197 ) ;
196198
199+ const popoverContainerStyle = useMemo ( ( ) => ( isSmallScreenWidth ? styles . w100 : { width : CONST . POPOVER_DROPDOWN_WIDTH } ) , [ isSmallScreenWidth , styles . w100 ] ) ;
200+
201+ const outerStyle = useMemo (
202+ ( ) => ( {
203+ ...( isSmallScreenWidth ? StyleUtils . getOuterModalStyle ( windowHeight , viewportOffsetTop ) : { } ) ,
204+ ...popoverContainerStyle ,
205+ } ) ,
206+ [ StyleUtils , isSmallScreenWidth , popoverContainerStyle , viewportOffsetTop , windowHeight ] ,
207+ ) ;
208+
197209 const innerContainerStyle = useMemo (
198210 ( ) => ( {
199- ...( isSmallScreenWidth ? styles . w100 : { width : CONST . POPOVER_DROPDOWN_WIDTH } ) ,
211+ ...popoverContainerStyle ,
200212 ...( isBottomDockedInLandscape ? styles . getPopoverMaxHeight ( windowHeight , true ) : { minHeight : popoverDimensions . minHeight } ) ,
201213 } ) ,
202- [ isSmallScreenWidth , isBottomDockedInLandscape , windowHeight , styles ] ,
214+ [ popoverContainerStyle , isBottomDockedInLandscape , windowHeight , styles ] ,
203215 ) ;
204216
205217 const reportSubmitToPopover = useMemo ( ( ) => {
@@ -210,6 +222,7 @@ function useReportSubmitToPopover({reportID, onSubmitSuccess, anchorAlignment =
210222 return (
211223 < PopoverWithMeasuredContent
212224 innerContainerStyle = { innerContainerStyle }
225+ outerStyle = { outerStyle }
213226 anchorRef = { anchorRef }
214227 isVisible = { isVisible }
215228 onClose = { closeReportSubmitToPopover }
@@ -223,11 +236,12 @@ function useReportSubmitToPopover({reportID, onSubmitSuccess, anchorAlignment =
223236 shouldSkipRemeasurement
224237 shouldDisplayBelowModals
225238 shouldUseModalPaddingStyle
239+ avoidKeyboard
226240 shouldWrapModalChildrenInScrollViewIfBottomDockedInLandscapeMode = { false }
227241 >
228242 < View
229243 collapsable = { false }
230- style = { [ StyleUtils . getHeight ( submitToPopoverContentHeight ) , styles . flexColumn , styles . pt4 ] }
244+ style = { [ StyleUtils . getHeight ( submitToPopoverContentHeight ) , styles . flexColumn , styles . flex1 , styles . w100 , styles . pt4 ] }
231245 >
232246 < ReportSubmitToContent
233247 key = { submitToContentKey }
@@ -246,8 +260,11 @@ function useReportSubmitToPopover({reportID, onSubmitSuccess, anchorAlignment =
246260 } , [
247261 StyleUtils ,
248262 styles . flexColumn ,
263+ styles . flex1 ,
249264 styles . pt4 ,
265+ styles . w100 ,
250266 innerContainerStyle ,
267+ outerStyle ,
251268 submitToPopoverContentHeight ,
252269 shouldRenderSubmitToPopover ,
253270 isVisible ,
0 commit comments