Skip to content

Commit a37e45a

Browse files
Xiaoyu Yinfacebook-github-bot
Xiaoyu Yin
authored andcommitted
Back out "Fixed scrollview inset when RN view is embedded in another 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
1 parent ff38f47 commit a37e45a

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

Libraries/Components/Keyboard/KeyboardAvoidingView.js

+1-22
Original file line numberDiff line numberDiff line change
@@ -118,28 +118,7 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
118118

119119
_onLayout = (event: ViewLayoutEvent) => {
120120
this._frame = event.nativeEvent.layout;
121-
122-
let isInitial = !this._initialFrameHeight;
123-
124-
if (this.viewRef.current !== null) {
125-
// Try to measure inside the window, not the view controller
126-
this.viewRef.current.measureInWindow((x, y, width, height) => {
127-
const frame: ViewLayout = {
128-
x: x,
129-
y: y,
130-
width: width,
131-
height: height,
132-
};
133-
this._frame = frame;
134-
135-
if (isInitial) {
136-
// save the initial frame height, before the keyboard is visible
137-
this._initialFrameHeight = frame.height;
138-
}
139-
});
140-
}
141-
142-
if (isInitial) {
121+
if (!this._initialFrameHeight) {
143122
// save the initial frame height, before the keyboard is visible
144123
this._initialFrameHeight = this._frame.height;
145124
}

0 commit comments

Comments
 (0)