Skip to content

Commit

Permalink
Back out "Fixed scrollview inset when RN view is embedded in another …
Browse files Browse the repository at this point in the history
…view"

Summary:
Original commit changeset: fbd72739fb71

Changelog: Back out "[react-native][PR] Fixed scrollview inset when RN view is embedded in another view"

Reviewed By: TheSavior

Differential Revision: D20878607

fbshipit-source-id: 0d77b9fb08c637f7894c399a219a242e472b0700
  • Loading branch information
Xiaoyu Yin authored and facebook-github-bot committed Apr 6, 2020
1 parent ff38f47 commit a37e45a
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions Libraries/Components/Keyboard/KeyboardAvoidingView.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,28 +118,7 @@ class KeyboardAvoidingView extends React.Component<Props, State> {

_onLayout = (event: ViewLayoutEvent) => {
this._frame = event.nativeEvent.layout;

let isInitial = !this._initialFrameHeight;

if (this.viewRef.current !== null) {
// Try to measure inside the window, not the view controller
this.viewRef.current.measureInWindow((x, y, width, height) => {
const frame: ViewLayout = {
x: x,
y: y,
width: width,
height: height,
};
this._frame = frame;

if (isInitial) {
// save the initial frame height, before the keyboard is visible
this._initialFrameHeight = frame.height;
}
});
}

if (isInitial) {
if (!this._initialFrameHeight) {
// save the initial frame height, before the keyboard is visible
this._initialFrameHeight = this._frame.height;
}
Expand Down

0 comments on commit a37e45a

Please sign in to comment.