From 96e1cc1c3f90e5698938bdb536fac556f302a1bc Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Sat, 10 Oct 2026 19:20:46 +0200 Subject: [PATCH] fix: open a list mail without mounting every pane before it #67 The tap fix makes a notification open a single page, so the viewer no longer needs to render up to the opened index. That setting mounted about N mail panes on every list open, on iOS too. Also drop the onScrollToIndexFailed handler, which FlatList never calls when getItemLayout is set. --- src/screens/EmailThreadScreen.tsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/screens/EmailThreadScreen.tsx b/src/screens/EmailThreadScreen.tsx index 84e1cfb1..cb1ed143 100644 --- a/src/screens/EmailThreadScreen.tsx +++ b/src/screens/EmailThreadScreen.tsx @@ -772,17 +772,12 @@ function EmailViewer({ route, navigation }: Props) { initialScrollIndex={initialIndexRef.current} getItemLayout={(_, index) => ({ length: windowWidth, offset: windowWidth * index, index })} windowSize={3} - initialNumToRender={Math.max(initialIndexRef.current + 1, 1)} + initialNumToRender={1} maxToRenderPerBatch={2} removeClippedSubviews scrollEnabled={!pagerLocked && kbObstruction === 0} onScrollBeginDrag={releaseNeighbours} onMomentumScrollEnd={onMomentumEnd} - onScrollToIndexFailed={(info) => { - setTimeout(() => { - listRef.current?.scrollToOffset({ offset: info.index * windowWidth, animated: false }); - }, 50); - }} renderItem={({ item, index }) => (