-
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
Viewport jumping up #16443
Merged
hayata-suenaga
merged 17 commits into
Expensify:main
from
gedu:edu/15270_viewport_jumping_up
Apr 21, 2023
+14
−5
Merged
Viewport jumping up #16443
Changes from 2 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
0713192
New locking height prop
gedu 81986b1
Cleanups
gedu be4fdf1
add lockHeight to Profile and SideBar Pages
gedu b6c8612
locking height to ReportScreen for messages
gedu 0f0628e
Merge branch 'main' into edu/15270_viewport_jumping_up
gedu c0af64c
lockheight for add payment screen
gedu 12a307a
Merge branch 'main' into edu/15270_viewport_jumping_up
gedu 276e23b
Updated max height handling
gedu 507f683
deleted again IOUModal
gedu 5a9acb2
fixing comments
gedu 873a6e7
Renamed enableMaxHeight to shouldEnableMaxHeight
gedu 4806e12
removed shouldEnabledMaxHeight here isn't necessary because now is fa…
gedu 1be9686
setting undefined to the style to remove it
gedu 77345f1
let the bottom button to move up
gedu 278b51c
Merge branch 'main' into edu/15270_viewport_jumping_up
gedu afb02f1
Merge branch 'main' into edu/15270_viewport_jumping_up
gedu b90d6c8
Changed shouldEnableMaxHeight to be false as default
gedu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,6 +94,8 @@ class ScreenWrapper extends React.Component { | |
} | ||
|
||
render() { | ||
const maxHeight = this.props.lockHeight ? null : this.props.windowHeight; | ||
|
||
return ( | ||
<SafeAreaConsumer> | ||
{({ | ||
|
@@ -118,7 +120,7 @@ class ScreenWrapper extends React.Component { | |
paddingStyle, | ||
]} | ||
> | ||
<KeyboardAvoidingView style={[styles.w100, styles.h100, {maxHeight: this.props.windowHeight}]} behavior={this.props.keyboardAvoidingViewBehavior}> | ||
<KeyboardAvoidingView style={[styles.w100, styles.h100, {maxHeight}]} behavior={this.props.keyboardAvoidingViewBehavior}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No inline styles cc: @thesahindia |
||
<HeaderGap /> | ||
{// If props.children is a function, call it to provide the insets to the children. | ||
_.isFunction(this.props.children) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why don't we depend on
Dimensions
(windowHeight
) insideKeyboardAvoidingView/index.web.js
and applymaxHeight
there? That would be a clean symmetry to theindex.ios.js
implementation and would reflect the general contract of the built-inKeyboardAvoidingView
.The
shouldEnableMaxHeight
would need to be forwarded to the in-houseKeyboardAvoidingView
, but would be accessed only on the Web implementation, which would improve clarity. Because themaxHeight
thing is only for the Web, right?I know that this PR does not introduce this code, but it does the biggest changes around it in a while, so if the original implementation was created in a way I'd describe as "confusing", I think we should clean it up 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.
Then, we'd also have a good place to comment on which browsers actually need that.
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.
@gedu, what do you think about this?