[HOLD for payment 2021-12-13] FAB - Options are shown for full screen width in iPad, it should show like how it’s handled in desktop - @Santhosh-Sellavel
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
- Open app in an iPad
- Click on the FAB / Plus button
Expected Result:
Global action menu should be displayed like in the desktop app, in a floating modal.
Actual Result:
Global action menu is displayed full-width across the screen.
Workaround:
None needed, visual issue.
Platform:
Where is this issue occurring?
- iOS (iPad ONLY)
Version Number: 1.1.6-0
Reproducible in staging?: yes **Reproducible in production?:**yes
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

Expensify/Expensify Issue URL:
Issue reported by: @Santhosh-Sellavel Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1631727718347500
Triggered auto assignment to @iwiznia (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
Triggered auto assignment to @bfitzexpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
Upwork post
Triggered auto assignment to @johnmlee101 (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.
PROPOSAL
This happens because in the Popover for native versions, it doesn't have the option for largeScreenWidth.
I propose use the same approach as the Popover for web and desktop versions.
https://github.com/Expensify/App/blob/5d9785b23ebfbfa4d7263b0134e245356071834a/src/components/Popover/index.js#L27-L37
And remove unused lines of code, like the lines where omits the animationIn, animationOut, popoverAnchorPosition. Since this props are being filtered by the isSmallScreenWidth prop.
https://github.com/Expensify/App/blob/5d9785b23ebfbfa4d7263b0134e245356071834a/src/components/Popover/index.native.js#L17
Also, It is needed to move the PopoverMenu above the View where the SidebarLinks and FAB are. If left the way it is, it causes to render an extra padding on the bottom for the iPad, which will overlap the Popover with the FAB. See attached videos.
https://user-images.githubusercontent.com/53409604/137022024-003671bf-d759-465f-87a9-7ab98609dc34.mp4
https://user-images.githubusercontent.com/53409604/137022054-db70a0fc-f677-4580-bbdb-809670924458.mp4
Another option is to create a variable popoverResponsiveWidthBreakpoint: 760, and in BasePopoverMenu.js pass a new prop to Popover component called useSmallScreenWidth.
<Popover
anchorPosition={this.props.anchorPosition}
onClose={this.props.onClose}
isVisible={this.props.isVisible}
onModalHide={this.props.onMenuHide}
animationIn={this.props.animationIn}
animationOut={this.props.animationOut}
useSmallScreenWidth={this.props.windowWidth <= variables.popoverResponsiveWidthBreakpoint}
>
In
if (!props.fullscreen && !props.useSmallScreenWidth) {
return createPortal(
<Modal
type={CONST.MODAL.MODAL_TYPE.POPOVER}
popoverAnchorPosition={props.anchorPosition}
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
animationIn={props.useSmallScreenWidth ? undefined : props.animationIn}
animationOut={props.useSmallScreenWidth ? undefined : props.animationOut}
shouldCloseOnOutsideClick
/>,
document.body,
);
}
This will allow us to control responsive popovers which is not dependent on the global responsive variable.
Example:
https://user-images.githubusercontent.com/26057318/137025576-f057415e-d71b-4f18-a9f0-de741e07a567.mp4
hi, I am from Upwork. can I get a chance to perform tasks,
Hi, I am from Upwork and have a solution for this issue! That's how I determined and fixed this issue:
The cause of the problem:
- The
Popovercomponent for the native version of the application is assigned aBOTTOM_DOCKEDtype that has a width of100%. - Also, the popover component for the native version is not wrapped in the
withWindowDimensionsfunction and therefore it does not get props that determine which screen size it belongs to. - Also the function
withWindowDimensionshas a bug due to which the propertyisMediumScreenWidthcan never be true if user rotate device and screen orientations has been changed (variablemediumScreenResponsiveWidthBreakpointdoes not exist).
Solution:
- Create an additional variable
MODAL_TYPE.POPOVER_TABLETand assign it the appropriate styles in thegetModalStyles.jsfile. - In the
index.native.jsfile, wrap Popover in thewisWindowDimensionsfunction. - Pass the condition with the corresponding variables to the type property.
- Fix errors with variables
This is the result of all points:
https://user-images.githubusercontent.com/52608209/137121202-bc26069a-cb1b-4db6-80b5-495d2b19631b.mp4
https://user-images.githubusercontent.com/52608209/137121768-affe8c45-1826-4390-a40e-862362413130.mp4
@johnmlee101 thoughts on the above proposals?
Bump! @johnmlee101
@johnmlee101 it's been 26 days since @ProkhoDim submitted the proposal, can you please review? https://github.com/Expensify/App/issues/5754#issuecomment-942189373
We are placing all non-critical issues on hold while we're on a company offsite. The hold is expected to be lifted on 11/19 (but could go longer). For any PRs that are submitted before or during the hold, we will add a $250 bonus payment.
@AlfredoAlc sorry for the delay. I like your proposal so let's go with that!
@ProkhoDim I liked yours as well, but the animation loses its transition and breaks a bit of the existing expectations of a slide in.
@akash191095 I think adding a new constant number to the mix feels less responsive than the solution we're going for, so thats why I prefer the first proposal.
We are placing all non-critical issues on hold while we're on a company offsite. The hold is expected to be lifted on 11/19 (but could go longer). For any PRs that are submitted before or during the hold, we will add a $250 bonus payment.
@johnmlee101 @mallenexpensify Does this means I should wait until the hold is lifted, or I can start working on fixing this issue ??
@AlfredoAlc please start working on the issue now and a submit a PR when it's ready. The bonus will only be applied if you submit your PR before Friday the 19th (or when the hold is lifted if it's after then, which it shouldn't be)
@mallenexpensify BTW, Upwork sent me a notification that the job has expired. I haven't been hired yet.
@AlfredoAlc , I created a new job, can you apply here plz https://www.upwork.com/jobs/~015cbedc439aa10aac
This was merged, waiting for deploy!
@mallenexpensify I applied but haven't yet been hired 👀
sorry for the delay @AlfredoAlc! Hired you. I'll end the contract and pay out the amount 7 days after deploy.