A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
mobile: fix jumping to incorrect match from search results
kashaf-ansari-deva6c20d0a4f5d
diff --git a/apps/mobile/app/components/list-items/search-result/index.tsx b/apps/mobile/app/components/list-items/search-result/index.tsxindex ec4934025..46ca1d1a3 100644--- a/apps/mobile/app/components/list-items/search-result/index.tsx+++ b/apps/mobile/app/components/list-items/search-result/index.tsx@@ -61,27 +61,28 @@ export const SearchResult = (props: SearchResultProps) => {};return (- <Pressable+ <Viewstyle={{alignSelf: "flex-start",alignItems: "flex-start",paddingHorizontal: DefaultAppStyles.GAP,paddingVertical: DefaultAppStyles.GAP_VERTICAL_SMALL,- borderRadius: 0+ width: "100%"}}- onLongPress={async () => {- const note = await db.notes.note(props.item.id);- Properties.present(note);- }}- onPress={async () => openNote()}>- <View+ <Pressablestyle={{flexDirection: "row",justifyContent: "space-between",alignItems: "center",- width: "100%"+ width: "100%",+ borderRadius: 0+ }}+ onLongPress={async () => {+ const note = await db.notes.note(props.item.id);+ Properties.present(note);}}+ onPress={async () => openNote()}><Viewstyle={{@@ -131,7 +132,7 @@ export const SearchResult = (props: SearchResultProps) => {{props.item.content.length}</Paragraph>) : null}- </View>+ </Pressable>{expanded &&!compactMode &&@@ -155,15 +156,15 @@ export const SearchResult = (props: SearchResultProps) => {}}onPress={() => {let activeIndex = 0;- for (let i = 0; i <= index; i++) {+ for (let i = 0; i < index; i++) {activeIndex += props.item.content[i].length;}openNote(activeIndex);}}><Paragraph>- {content.map((match, index) => (- <React.Fragment key={props.item.id + index + "src"}>+ {content.map((match, matchIndex) => (+ <React.Fragment key={props.item.id + matchIndex + "src"}>{match.prefix}<Paragraphsize={AppFontSize.sm}@@ -180,6 +181,6 @@ export const SearchResult = (props: SearchResultProps) => {</Paragraph></Pressable>))}- </Pressable>+ </View>);};