Skip to content
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

Fix footer position on the login page in mobile View #6203

Merged
merged 8 commits into from
Nov 15, 2021

Conversation

parasharrajat
Copy link
Member

@parasharrajat parasharrajat commented Nov 4, 2021

Details

Fixed Issues

$ #6175
$ #6202

Tests | QA Steps

  1. Open Login Page. The footer should be bottom aligned.
  2. Focus on the email field, continue button and email input should be visible completely.
  3. Click continue,
  4. click to enter the password. Password input and continue button and go backlink should be over the keyboard.

Note: Wide Screen layout is fixed in separate issue and which affect web | desktop | Ipad | Tablet | landscape view and the PR for the same is #6137.

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

image

Mobile Web

image

Desktop

image

iOS

Screenshot 2021-11-08 01:13:25

Android

Screenshot 2021-11-07 19:05:24
Screenshot 2021-11-07 19:05:06
Screenshot 2021-11-07 22:45:58

…iew above keyboard

It is a little tricky to manage the various parts of UI above and below the keyboard together but:-
- Created a Flex 1 container which will respect the position behaviour.
- Now move all the styles to content of the keyboardAvoidView.
- There is some sort of problem that keeps some part of view behind the keyboard. It could be some thing but I am not aware of so I tried various padding and it seem that 20px will be hidden behind the keyboard.
- so I moved the margin from footer to this and added pb5.
@parasharrajat parasharrajat marked this pull request as ready for review November 7, 2021 19:47
@parasharrajat parasharrajat requested a review from a team as a code owner November 7, 2021 19:47
@botify botify requested a review from luacmartins November 7, 2021 19:47
@MelvinBot MelvinBot removed the request for review from a team November 7, 2021 19:47
Copy link
Contributor

@luacmartins luacmartins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The footer shifts up as soon as we start typing on Android. Maybe extending signInPageStyles.js/index.ios.js to include Android would fix this.

android.mov

@parasharrajat
Copy link
Member Author

I will check it.

@luacmartins
Copy link
Contributor

@parasharrajat let me know when this is ready for another review.

@parasharrajat
Copy link
Member Author

Thanks. Just trying to find a way to trigger the ui update when keyboard opens which happens when you type on input.

Explicitly trigger the page layout update when keyboard shows to remove glitch
@parasharrajat
Copy link
Member Author

@luacmartins Fixed it. Basically, when you type the LoginPage rerender but it does not when the keyboard is shown. So I created on HOC to trigger rerender when the keyboard becomes visible.

@luacmartins
Copy link
Contributor

luacmartins commented Nov 12, 2021

Hey @parasharrajat! I pulled the latest changes, but I still see the footer shifting up when the keyboard is displayed on Android. Maybe I'm missing something here. Can you double check please?

@parasharrajat
Copy link
Member Author

Ok. Checking now. may be I missed something.

@parasharrajat
Copy link
Member Author

parasharrajat commented Nov 12, 2021

@luacmartins It works on all of the three devices I tested.
Pixel 4 XL

output_file.mp4

Oops, you asked for footer placement.

Yeah, this is basically fine, I coded it this way. There is no issue with this unless the continue button does not show above the keyboard. It was really hard to achieve. we use adjustResize in Android which will move the whole view above the keyboard and resize the window on keyboardOpen. it means the whole scrollview including the footer will be placed on the top of the keyboard, pushing the main content off the screen. I am managed to keep the footer behind the keyboard so that only the main content is above the keyboard.

It satisfies both issues:

  1. Footer placement should be bottom of the screen. (I don't think it really matters when it is shifted above when the keyboard is open).
  2. Keep the main content above the keyboard. (If I will remove that behaviour, then the whole footer will go above the keyboard which I think will become another issue.)

@luacmartins
Copy link
Contributor

I see... I dislike the layout shift, but I agree that that is a minor detail here. Approving.

@luacmartins luacmartins merged commit 6313603 into Expensify:main Nov 15, 2021
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @luacmartins in version: 1.1.14-5 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@ogumen
Copy link

ogumen commented Nov 21, 2021

The accessibility issue related to the mWeb on Android:

  1. There is no possibility to zoom the page content using pinch-to-zoom on Android devices (happens due to user-scalable attribute set to "no" in <meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1">, the iOS devices ignore this setting) - failure of WCAG SC 1.4.4
    https://user-images.githubusercontent.com/88733897/142783792-a57a7363-3b36-4142-b146-b8864b576a11.mp4

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @AndrewGable in version: 1.1.15-15 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@@ -0,0 +1,5 @@
import styles from '../../../../styles/styles';

const scrollViewContentContainerStyles = styles.flex1;
Copy link
Member

@rushatgabhane rushatgabhane Jan 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious why flex1 was used here for iOS? Replacing it with mnh100 doesn't break UI for iPhone, iPad or iPod
contd.. below

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not remember but I'm sure there was some UI thing. I will get back to you on this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, take your time. Thanks!

Copy link
Member Author

@parasharrajat parasharrajat Jan 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rushatgabhane I looked into this one. I added this as minHeight: 100% makes the Login Page height become more than the screen height and thus page will become scrollable even if we have enough space to fit the whole content.

minHeight: 100% was added for Android, It is supposed to be flex1. Android does not work good with flex1.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

welp, we made iOS use minHeight 100% in this PR #7205
This is the behaviour that we get after making the changes. It's same as using flex1 at least on the sim 😅

Screen.Recording.2022-01-16.at.1.50.17.AM.mov

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clear the cache and then run it. I don't remember but it i visible sometimes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your help. Yep, it's a problem only sometimes so missed it during review.

It's a regression. I'll comment in original issue.

@@ -0,0 +1,5 @@
import styles from '../../../../styles/styles';

const scrollViewContentContainerStyles = styles.mnh100;
Copy link
Member

@rushatgabhane rushatgabhane Jan 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mnh100 like here for rest of the platforms

Copy link
Member

@rushatgabhane rushatgabhane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@parasharrajat just have a question here for issue 7122

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants