@react-native-oh/react-native-harmony 0.72.28-2 → 0.72.28-4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -684,8 +684,6 @@ type State = {|
684
684
  // RNOH patch - resolving flashScrollIndicators command on the JS side
685
685
  // as it is currently not feasible on the native side
686
686
  showScrollIndicator: boolean,
687
- contentOffset: ?number,
688
- contentHeight: ?number,
689
687
  |};
690
688
 
691
689
  const IS_ANIMATING_TOUCH_START_THRESHOLD_MS = 16;
@@ -774,8 +772,6 @@ class ScrollView extends React.Component<Props, State> {
774
772
  // RNOH patch - resolving flashScrollIndicators command on the JS side
775
773
  // as it is currently not feasible on the native side
776
774
  showScrollIndicator: false,
777
- contentOffset: null,
778
- contentHeight: null,
779
775
  };
780
776
 
781
777
  componentDidMount() {
@@ -1192,15 +1188,14 @@ class ScrollView extends React.Component<Props, State> {
1192
1188
  );
1193
1189
  }
1194
1190
  }
1195
- this.setState({
1196
- contentOffset: e.nativeEvent.contentOffset.y
1197
- });
1198
1191
  this._observedScrollSinceBecomingResponder = true;
1199
1192
  this.props.onScroll && this.props.onScroll(e);
1200
1193
  };
1201
1194
 
1202
1195
  _handleLayout = (e: LayoutEvent) => {
1203
- this.setState({ layoutHeight: e.nativeEvent.layout.height });
1196
+ if (this.props.invertStickyHeaders === true) {
1197
+ this.setState({ layoutHeight: e.nativeEvent.layout.height });
1198
+ }
1204
1199
  if (this.props.onLayout) {
1205
1200
  this.props.onLayout(e);
1206
1201
  }
@@ -1208,26 +1203,6 @@ class ScrollView extends React.Component<Props, State> {
1208
1203
 
1209
1204
  _handleContentOnLayout = (e: LayoutEvent) => {
1210
1205
  const { width, height } = e.nativeEvent.layout;
1211
- /**
1212
- * RNOH patch - Fixed the issue where sticky headers are in disordered position after foldable phone is expanded/folded.
1213
- * When a foldable phone is expanded/folded, the height of the list items often changes,
1214
- * causing the content height of the ScrollView to change.
1215
- * But since the scroll event is not triggered, the position of the sticky headers is
1216
- * still offset according to the original content height.
1217
- * So we should recalculate the contentOffset based on the new contentHeight and trigger
1218
- * the scroll event to fix the position of sticky headers
1219
- */
1220
- let { contentOffset, contentHeight, layoutHeight } = this.state;
1221
- if (contentOffset && contentHeight) {
1222
- contentOffset *= (height - layoutHeight) / (contentHeight - layoutHeight);
1223
- (contentOffset < 0) && (contentOffset = 0);
1224
- this.scrollTo({ y: contentOffset, animated: false });
1225
- this._scrollAnimatedValue.setValue(contentOffset);
1226
- }
1227
- this.setState({
1228
- contentOffset,
1229
- contentHeight: height
1230
- });
1231
1206
  this.props.onContentSizeChange &&
1232
1207
  this.props.onContentSizeChange(width, height);
1233
1208
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-oh/react-native-harmony",
3
- "version": "0.72.28-2",
3
+ "version": "0.72.28-4",
4
4
  "description": "",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",
@@ -49,7 +49,7 @@
49
49
  "./*.har"
50
50
  ],
51
51
  "dependencies": {
52
- "@react-native-oh/react-native-harmony-cli": "^0.0.26-13",
52
+ "@react-native-oh/react-native-harmony-cli": "^0.0.26-15",
53
53
  "colors": "^1.4.0",
54
54
  "fs-extra": "^11.1.1",
55
55
  "metro": "^0.76.3",
Binary file