Landscape UI - Unable to close FAB menu and notch is blocking some content from the preferences page - Reported by: @kakajann
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:
- Navigate to LHN
- Open FAB menu
- Change orientation to landscape
- Change back orientation to portrait
- Navigate to settings
- Open preferences
- Change orientation to landscape.
Expected Result:
UI should not break after changing orientation to landscape.
Actual Result:
User is unable to exit the FAB menu in preferences some UI elements are blocked by notch. Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platform:
Where is this issue occurring?
- iOS
- Android
Version Number: 1.1.8-0
Reproducible in staging?: Yes Reproducible in production?: Yes
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

Upwork job link: https://www.upwork.com/jobs/~017190bb5038fac386
Issue reported by: @kakajann Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1634299085343500
Triggered auto assignment to @pecanoro (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
Triggered auto assignment to @michaelhaxhiu (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
Proposal
- Create a new component to handle SafeArea for iPhoneX
src/components/SafeArea/index.js
const SafeArea = ({children}) => children;
export default SafeArea;
src/components/SafeArea/index.ios.js
const SafeArea = ({children}) => (
<SafeAreaView style={[styles.iPhoneXSafeArea]} edges={['left', 'right']}>
{children}
</SafeAreaView>
);
export default SafeArea;
- Use it in
App.js
<SafeArea>
<Expensify />
</SafeArea>
This will solve the issue about blocked UI elements.
More Details
Apple suggests to use padding both sides in landscape mode on iPhoneX and this leads background color mismatch. Like this:
and I had to set safeArea backgroundColor black. Like this:
I don't think we can detect the orientation is left or right
I think it looks better with the black BG.
@michaelhaxhiu Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@michaelhaxhiu 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
Sorry on the delay guys - I got assigned this GH while I was OOO (somehow?).
I can confirm this GH is unique and reproducible. Upwork job is posted: https://www.upwork.com/jobs/~017190bb5038fac386
Triggered auto assignment to @Julesssss (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@parasharrajat I saw you added a thumbs down to the proposal above, was there a specific reason for this?
Wrapping the whole app in safe area is not a best approach.
Main LHN takes full screen ...etc. It will have side-effects.
@parasharrajat @Julesssss is this settled? I wanted to propose a slightly different approach
@sidferreira we are still reviewing proposals, feel free to post yours here.
Proposal
For most solution I agree with @kakajann but instead of using it app wise, I suggest to use it screen-based, for a better UI experience. This will allow the app to have a better result depending on what side it was rotated.
For example, the issue mentioned happens only if you rotate the device to the right, not if you rotate left. As well the problem of adding the whole app to the SafeArea causes the FAB shadow to not be complete.
So whatever changes, should make sure that the FAB shadow will render til the border of the device.
Follows some examples of the issue in different screens/orientations:
I basically think that this is kinda bigger problem than just the FAB menu
I don't think wrapping the app with custom SafeArea will be bad approach. Because it works with:
- Only on iOs devices
- Only on iPhone X and newer models
- Only on Landscape orientation
@kakajann I didn't want to mention it as a "bad" approach, sorry if sounded like that. The difference is about final results. Part of the expected UI behaviours on iOS is to have the content "bleeding" behind the notch, a behaviour that I personally enjoy, that's why I suggested a different approach.
@sidferreira I was talking about @parasharrajat 's comment ) sorry I forgot to mention
Because it works with:
- Only on iOs devices
@kakajann what exactly do you mean here? That the safe area is only applied to the cases in which it is necessary?
@sidferreira selectively applying the fix to specific screens sounds a better solution to me, and it looks much better to have the extended background colours. But I wonder if the safe area should apply to specific devices, or all?
That the safe area is only applied to the cases in which it is necessary?
Exactly.
Only on iOs devices
Because we define it in SafeArea/index.ios.js
Only on iPhone X and newer models
This will be handled by React Natives SafeAreaView
Only on Landscape orientation
edges={['left', 'right']} prop is enough to achieve it
@Julesssss the component calculates and applies the margins based on the device type. It's pretty safe in my experience.
@sidferreira ideally, this solution would include padding for any right docked modal to avoid the notch covering some UI. Is this something that could also be achieved with your proposal? And if so, would we achieve this by applying SafeArea to the ScreenWrapper component?
For reference, there are quite a few flows with the right docked page: New Group/Chat, Request/Send Money, Settings, ect.