Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix scrolling

ammarahm-ed6d206d5fbe2d
diff --git a/apps/mobile/ios/Notesnook.xcodeproj/project.pbxproj b/apps/mobile/ios/Notesnook.xcodeproj/project.pbxproj
index 8852d6bb4..1a2462137 100644
--- a/apps/mobile/ios/Notesnook.xcodeproj/project.pbxproj
+++ b/apps/mobile/ios/Notesnook.xcodeproj/project.pbxproj
@@ -590,7 +590,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "set -e\n\nexport NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
+ shellScript = "set -e\n\nexport NODE_BINARY=node\nexport BUNDLE_COMMAND=webpack-bundle\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
};
23B3F321642872B180473574 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
@@ -738,7 +738,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
+ shellScript = "export NODE_BINARY=node\nexport BUNDLE_COMMAND=webpack-bundle\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
};
74EE9ED768E52033B174E41C /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
diff --git a/apps/mobile/src/components/dialogs/jumptosection/index.js b/apps/mobile/src/components/dialogs/jumptosection/index.js
index baaa30968..4def3def1 100644
--- a/apps/mobile/src/components/dialogs/jumptosection/index.js
+++ b/apps/mobile/src/components/dialogs/jumptosection/index.js
@@ -21,7 +21,7 @@ const JumpToSectionDialog = ({ scrollRef, data, type, screen }) => {
const onPress = (item, index) => {
let ind = notes.findIndex(i => i.title === item.title && i.type === 'header');
- console.log(ind);
+ console.log(scrollRef.current);
scrollRef.current?.scrollToIndex({
index: ind,
animated: true
diff --git a/apps/mobile/src/components/list/index.js b/apps/mobile/src/components/list/index.js
index 8e1391d93..45310a4f3 100644
--- a/apps/mobile/src/components/list/index.js
+++ b/apps/mobile/src/components/list/index.js
@@ -1,5 +1,5 @@
import React, { useRef } from 'react';
-import { RefreshControl, View } from 'react-native';
+import { FlatList, RefreshControl, View } from 'react-native';
import Animated, { FadeInDown } from 'react-native-reanimated';
import { notesnook } from '../../../e2e/test.ids';
import { eSendEvent } from '../../services/event-manager';
@@ -109,57 +109,63 @@ const List = ({
return (
<>
- <Animated.FlatList
- entering={type === 'search' ? undefined : FadeInDown}
- style={styles}
- keyExtractor={_keyExtractor}
- ref={scrollRef}
- testID={notesnook.list.id}
- data={listData}
- renderItem={renderItem}
- onScroll={_onScroll}
- windowSize={5}
- onMomentumScrollEnd={() => {
- tabBarRef.current?.unlock();
+ <Animated.View
+ style={{
+ flex: 1
}}
- initialNumToRender={10}
- keyboardShouldPersistTaps="always"
- keyboardDismissMode="interactive"
- refreshControl={
- <RefreshControl
- tintColor={colors.accent}
- colors={[colors.accent]}
- progressBackgroundColor={colors.nav}
- onRefresh={_onRefresh}
- refreshing={false}
- />
- }
- ListEmptyComponent={
- <Empty
- loading={loading}
- placeholderData={placeholderData}
- headerProps={headerProps}
- type={type}
- screen={screen}
- />
- }
- ListFooterComponent={<Footer />}
- ListHeaderComponent={
- <>
- {ListHeader ? (
- ListHeader
- ) : (
- <Header
- title={headerProps.heading}
- color={headerProps.color}
- type={type}
- screen={screen}
- warning={warning}
- />
- )}
- </>
- }
- />
+ entering={type === 'search' ? undefined : FadeInDown}
+ >
+ <FlatList
+ style={styles}
+ keyExtractor={_keyExtractor}
+ ref={scrollRef}
+ testID={notesnook.list.id}
+ data={listData}
+ renderItem={renderItem}
+ onScroll={_onScroll}
+ windowSize={5}
+ onMomentumScrollEnd={() => {
+ tabBarRef.current?.unlock();
+ }}
+ initialNumToRender={10}
+ keyboardShouldPersistTaps="always"
+ keyboardDismissMode="interactive"
+ refreshControl={
+ <RefreshControl
+ tintColor={colors.accent}
+ colors={[colors.accent]}
+ progressBackgroundColor={colors.nav}
+ onRefresh={_onRefresh}
+ refreshing={false}
+ />
+ }
+ ListEmptyComponent={
+ <Empty
+ loading={loading}
+ placeholderData={placeholderData}
+ headerProps={headerProps}
+ type={type}
+ screen={screen}
+ />
+ }
+ ListFooterComponent={<Footer />}
+ ListHeaderComponent={
+ <>
+ {ListHeader ? (
+ ListHeader
+ ) : (
+ <Header
+ title={headerProps.heading}
+ color={headerProps.color}
+ type={type}
+ screen={screen}
+ warning={warning}
+ />
+ )}
+ </>
+ }
+ />
+ </Animated.View>
<JumpToSectionDialog
screen={screen}
data={listData}