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 "Going from small to large screen and vice-versa clears the field for Email/Password input fields" #11304

Merged
merged 2 commits into from
Oct 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions src/pages/signin/SignInPageLayout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,25 @@ const SignInPageLayout = (props) => {
</Pressable>
);

if (props.isSmallScreenWidth) {
return content;
}
let containerStyles = [styles.flex1, styles.signInPageInner];
let contentContainerStyles = [styles.flex1, styles.flexRow];

if (props.isMediumScreenWidth && props.windowHeight >= variables.minHeightToShowGraphics) {
return (
<View style={[styles.dFlex, styles.signInPageInner, styles.flexColumnReverse, styles.justifyContentBetween]}>
{graphicLayout}
<View style={styles.flex1}>
{content}
</View>
</View>
);
const isLongMediumScreenWidth = props.isMediumScreenWidth && props.windowHeight >= variables.minHeightToShowGraphics;

if (props.isSmallScreenWidth) {
containerStyles = [styles.flex1];
contentContainerStyles = [styles.flex1];
} else if (isLongMediumScreenWidth) {
containerStyles = [styles.dFlex, styles.signInPageInner, styles.flexColumnReverse, styles.justifyContentBetween];
contentContainerStyles = [styles.flex1];
}

return (
<View style={[styles.flex1, styles.signInPageInner]}>
<View style={[styles.flex1, styles.flexRow, styles.flexGrow1]}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here we have flexGrow1 it's removed in refactored code and won't create any regressions.

Copy link
Contributor Author

@aimane-chnaif aimane-chnaif Oct 3, 2022

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed this because style conflicts and UI broken while going from large to medium screen by decreasing width
conflict

Copy link
Collaborator

Choose a reason for hiding this comment

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

Cool thanks!

<View style={containerStyles}>
{isLongMediumScreenWidth && graphicLayout}
<View style={contentContainerStyles}>
{content}
{graphicLayout}
{!props.isSmallScreenWidth && !isLongMediumScreenWidth && graphicLayout}
</View>
</View>
);
Expand Down