-
Notifications
You must be signed in to change notification settings - Fork 3k
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 the keyboard overlapping buttons on the sign in form #12848
Conversation
@aimane-chnaif @cristipaval One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@tgolen could i please review this PR because i was assigned to the issue for this PR |
@tgolen this might be a dumb question - how to dismiss keyboard on iOS? (i tried drag outside text input) usecase: See the footer which has ToS and language selector a.mov |
@rushatgabhane Yeah, feel free to review! I've gone and added you. I have fixed the keyboard dismissing issue (had to add back in the scrollview). |
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
Shall I review this PR as I am assigned? |
Anyone can review it :D The more the merrier! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @tgolen ! I tested your branch and looks like the submit button is still partially covered by the keyboard.
Screen.Recording.2022-11-21.at.17.19.51.mov
This is NexusOne with Android 10
@cristipaval could you please re-upload the recording, thanks! |
should work now |
Thanks @cristipaval! I think that will be OK. I don't think that's a supported device or android version? Is that what you normally test with? |
This is an emulator on which I usually test to see how the App behaves on smaller screens. The Android 10 it's not old I'd say, so we should support it. I do agree that the behaviour is still fine, even if the button is completely covered by the keyboard, as long as we have the submit action on the keyboard working as a physical tap on the submit button. |
I checked with QA and they are only required to test on Android 11 and above, so I think what you're seeing there is OK. |
Yes it works better on newer Android versions. Looks like Screen.Recording.2022-11-21.at.19.35.57.mov |
signin.mp4In video, 00:00-00:06 is before fix, 00:07-00:13 is after fix
|
OK, thanks for the testing! I'll work on those today and tomorrow and see what I come up with. |
Oh, ha... typo in the prop for |
Branch updated! I believe I got everything addressed:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just noticed some typos, overall looks good
<SignInPageForm style={[ | ||
const SignInPageContent = (props) => { | ||
const dismissKeyboardWhenTappedOutsideOfInput = () => { | ||
// This prop comes from with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// This prop comes from with | |
// This prop comes from withKeyboardState |
props.isSmallScreenWidth ? styles.ph5 : styles.ph4, | ||
styles.signInPageLeftContainer, | ||
|
||
// Restrict the width if the left container only for large screens. For smaller screens, the width needs to be fluid to span the entire width of the page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Restrict the width if the left container only for large screens. For smaller screens, the width needs to be fluid to span the entire width of the page. | |
// Restrict the width of the left container only for large screens. For smaller screens, the width needs to be fluid to span the entire width of the page. |
styles.signInPageLeftContainer, | ||
|
||
// Restrict the width if the left container only for large screens. For smaller screens, the width needs to be fluid to span the entire width of the page. | ||
!props.isMediumScreenWidth && !props.isSmallScreenWidth && styles.signInPageWideLeftContainer, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NAB: Wondering why we don't have a isLargeScreenWidth
prop for times like these
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, that's a great point. I want to refactor it a little to have this.
Ack, I just realized I didn't push up the code for that last change. Anyway, the code is there now 😅 |
src/styles/styles.js
Outdated
signInPageLeftContainerMediumScreen: { | ||
maxWidth: 400, | ||
marginLeft: 'auto', | ||
marginRight: 'auto', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, this stuff is so finicky.
The reason I added the auto-margins is:
- Shawn requested to have the form use a max-width
- Setting a maxWidth works for the form, but for medium-sized screens, the form is aligned on the left side of the container and looks bad. The form needs to be horizontally centered in the container.
- My first thought was to use
alignSelfCenter
, and that works. BUT at small screen widths, that style also centers the content vertically 😡 and adds a lot of unintended margin to the top and bottom - So I went with the auto margin route, which makes the form horizontally centered AND doesn't mess up any vertical margins
I have fiddled with it again today to remove the margin auto and get the alignSelfCenter
working.
I narrowed the problem you saw with iPhone SE down to the props.welcomeText
. It seems the difference in text was causing the width of the container to change size... so I have restricted that text to 300px wide always.
Updated!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you (or a reviewer) share a quick video of the sign in page going from small to wide? Just want to check and see how the responsive styles are working, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you go:
2022-12-01_12-50-20.mp4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, looks good to me, thanks for making the video!
@tgolen please pull from latest |
Updated to resolve conflicts. |
doing final test now |
NOTE: This is already logged here and will be fixed in this PR |
Looks good to me and tests well on all platforms with various screen sizes (except android chrome on very small device commented here) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks great and tests well on all platforms! Unable to replicate the broken small-screen android case, but I imagine that's an edge case so I'm approving. Let's create a follow-up issue for that?
Quick follow-up up coming from the main issue. This PR looks ready to merge aside from @jasperhuangg's point above. Let's get this one merged today! |
Yep, since it's been twice approved, I'll go ahead and self-merge this so we can finally get it done. |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to production by @chiragsalian in version: 1.2.38-6 🚀
|
Just FYI that this PR caused #13488. |
Leaving a note that this PR caused #13920
|
@eVoloshchak could you please explain why it caused it? |
@rushatgabhane, sure!
So it was resolved by using platform-specific files and using touchable only on iOS |
Details
The page was originally built with using a top margin set to a percentage of the page height. Because of that, when the keyboard opens, the page wasn't properly collapsing the top margin in order to reveal the entire form. I restructured the entire layout to properly use flex techniques to allow the section to collapse as intended.
Fixed Issues
$ #11701
Tests
For web specifically:
Test keyboard dismissing on native (iOS and Android):
Offline tests
QA Steps
Same as the tests above
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)PR Reviewer Checklist
The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
have been tested & I retested again)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android