Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): prevent chat from disappearing when scrolling #10479

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/10479/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 48 additions and 24 deletions.

x
0 of 2 viewed, 2 left
48 additions and 24 deletionspatches/@legendapp__list@3.3.5.patchModified
View file
@@ -241,7 +241,7 @@
* Number of columns to render items in.
* @default 1
diff --git a/react-native.js b/react-native.js
-index b3c5a306b293f797a8b338adfca3060c0f6db22b..24d0763aef074411eb7d17f0feb8df752a843de0 100644
+index b3c5a306b293f797a8b338adfca3060c0f6db22b..ddca4bcd8a5dc5863cb65e03b6cfac0047a8ead3 100644
--- a/react-native.js
+++ b/react-native.js
@@ -717,6 +717,15 @@ function hasActiveInitialScroll(state) {
@@ -674,7 +674,19 @@
contentContainerStyle: [
horizontal ? { height: "100%" } : {},
contentContainerStyle,
-@@ -6751,7 +6950,7 @@ function createImperativeHandle(ctx, scheduleImperativeScrollCommit) {
+@@ -6010,7 +6209,10 @@ var ListComponent = typedMemo(function ListComponent2({
+ ],
+ contentOffset: initialContentOffset !== void 0 ? horizontal ? { x: initialContentOffset, y: 0 } : { x: 0, y: initialContentOffset } : void 0,
+ horizontal,
+- maintainVisibleContentPosition: maintainVisibleContentPosition.size || maintainVisibleContentPosition.data ? { minIndexForVisible: 0 } : void 0,
++ // Keep iOS anchored to ScrollAdjust even when JS position restoration is
++ // disabled. Re-enabling native MVCP mid-drag can compare its stale anchor
++ // with the 1e7 sentinel and scroll the entire list out of view.
++ maintainVisibleContentPosition: Platform.OS === "ios" || maintainVisibleContentPosition.size || maintainVisibleContentPosition.data ? { minIndexForVisible: 0 } : void 0,
+ onLayout,
+ onScroll: onScroll2,
+ ref: refScrollView,
+@@ -6751,7 +6953,7 @@ function createImperativeHandle(ctx, scheduleImperativeScrollCommit) {
endBuffered: state.endBuffered,
getAverageItemSizes: () => getAverageItemSizes(state),