From aa6c026a9e58721ad1178b21c61c66fb7b36aaac Mon Sep 17 00:00:00 2001 From: dominictb Date: Mon, 16 Sep 2024 03:28:25 +0700 Subject: [PATCH 1/8] fix: pasting long text freezes app --- src/hooks/useHtmlPaste/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hooks/useHtmlPaste/index.ts b/src/hooks/useHtmlPaste/index.ts index 6199a36abdca..7d1e9135be34 100644 --- a/src/hooks/useHtmlPaste/index.ts +++ b/src/hooks/useHtmlPaste/index.ts @@ -1,6 +1,7 @@ import {useNavigation} from '@react-navigation/native'; import {useCallback, useEffect} from 'react'; import Parser from '@libs/Parser'; +import CONST from '@src/CONST'; import type UseHtmlPaste from './types'; const insertByCommand = (text: string) => { @@ -40,7 +41,9 @@ const useHtmlPaste: UseHtmlPaste = (textInputRef, preHtmlPasteCallback, removeLi if (textInputHTMLElement?.hasAttribute('contenteditable')) { insertAtCaret(textInputHTMLElement, text); } else { - insertByCommand(text); + (textInputRef.current as unknown as HTMLInputElement)?.setRangeText(text, 0, 0, 'end'); + // Trigger the onChange event, which sync the pasted value with the text input state + textInputHTMLElement?.dispatchEvent(new Event('input', {bubbles: true})); } // Pointer will go out of sight when a large paragraph is pasted on the web. Refocusing the input keeps the cursor in view. @@ -64,7 +67,7 @@ const useHtmlPaste: UseHtmlPaste = (textInputRef, preHtmlPasteCallback, removeLi */ const handlePastedHTML = useCallback( (html: string) => { - paste(Parser.htmlToMarkdown(html)); + paste(html.length <= CONST.MAX_MARKUP_LENGTH ? Parser.htmlToMarkdown(html) : html); }, [paste], ); From 3cdebacafb78dad35dfdb17212822f806531de43 Mon Sep 17 00:00:00 2001 From: dominictb Date: Tue, 8 Oct 2024 22:00:42 +0700 Subject: [PATCH 2/8] fix: handle maxLength in useHtmlPaste --- package-lock.json | 8 +-- package.json | 2 +- src/CONST.ts | 3 -- src/components/RNMarkdownTextInput.tsx | 8 ++- src/hooks/useHtmlPaste/index.ts | 68 ++++++++++++++++---------- src/hooks/useHtmlPaste/types.ts | 1 + 6 files changed, 54 insertions(+), 36 deletions(-) diff --git a/package-lock.json b/package-lock.json index 696192f6771f..49c0b419def1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "license": "MIT", "dependencies": { "@dotlottie/react-player": "^1.6.3", - "@expensify/react-native-live-markdown": "0.1.143", + "@expensify/react-native-live-markdown": "0.1.168", "@expo/metro-runtime": "~3.2.3", "@firebase/app": "^0.10.10", "@firebase/performance": "^0.6.8", @@ -3634,9 +3634,9 @@ } }, "node_modules/@expensify/react-native-live-markdown": { - "version": "0.1.143", - "resolved": "https://registry.npmjs.org/@expensify/react-native-live-markdown/-/react-native-live-markdown-0.1.143.tgz", - "integrity": "sha512-hZXYjKyTl/b2p7Ig9qhoB7cfVtTTcoE2cWvea8NJT3f5ZYckdyHDAgHI4pg0S0N68jP205Sk5pzqlltZUpZk5w==", + "version": "0.1.168", + "resolved": "https://registry.npmjs.org/@expensify/react-native-live-markdown/-/react-native-live-markdown-0.1.168.tgz", + "integrity": "sha512-NTyjM2+1dHcZxHFT+uHqXK7SMsssLTVWfmKtoVluJRjV3JTWdflpReD0EIjSnJbZodeyrFkiqCgqOsTLMUNaYg==", "workspaces": [ "parser", "example", diff --git a/package.json b/package.json index d71ecd5339e2..4ea8eae540f9 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ }, "dependencies": { "@dotlottie/react-player": "^1.6.3", - "@expensify/react-native-live-markdown": "0.1.143", + "@expensify/react-native-live-markdown": "0.1.168", "@expo/metro-runtime": "~3.2.3", "@firebase/app": "^0.10.10", "@firebase/performance": "^0.6.8", diff --git a/src/CONST.ts b/src/CONST.ts index 0163cec3e0a5..f31ef3f97c85 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -2785,9 +2785,6 @@ const CONST = { // Auth limit is 60k for the column but we store edits and other metadata along the html so let's use a lower limit to accommodate for it. MAX_COMMENT_LENGTH: 10000, - // Use the same value as MAX_COMMENT_LENGTH to ensure the entire comment is parsed. Note that applying markup is very resource-consuming. - MAX_MARKUP_LENGTH: 10000, - MAX_THREAD_REPLIES_PREVIEW: 99, // Character Limits diff --git a/src/components/RNMarkdownTextInput.tsx b/src/components/RNMarkdownTextInput.tsx index d36af6e13826..8101dd990641 100644 --- a/src/components/RNMarkdownTextInput.tsx +++ b/src/components/RNMarkdownTextInput.tsx @@ -5,13 +5,14 @@ import React from 'react'; import type {TextInput} from 'react-native'; import Animated from 'react-native-reanimated'; import useTheme from '@hooks/useTheme'; +import CONST from '@src/CONST'; // Convert the underlying TextInput into an Animated component so that we can take an animated ref and pass it to a worklet const AnimatedMarkdownTextInput = Animated.createAnimatedComponent(MarkdownTextInput); type AnimatedMarkdownTextInputRef = typeof AnimatedMarkdownTextInput & TextInput & HTMLInputElement; -function RNMarkdownTextInputWithRef(props: MarkdownTextInputProps, ref: ForwardedRef) { +function RNMarkdownTextInputWithRef({maxLength, ...props}: MarkdownTextInputProps, ref: ForwardedRef) { const theme = useTheme(); return ( @@ -27,6 +28,11 @@ function RNMarkdownTextInputWithRef(props: MarkdownTextInputProps, ref: Forwarde }} // eslint-disable-next-line {...props} + /** + * If maxLength is not set, we should set the it to CONST.MAX_COMMENT_LENGTH + 1, to avoid parsing markdown for large text + * Since we want the ExceededCommentLength to be displayed, we need to set the maxLength to CONST.MAX_COMMENT_LENGTH + 1 + */ + maxLength={maxLength ?? CONST.MAX_COMMENT_LENGTH + 1} /> ); } diff --git a/src/hooks/useHtmlPaste/index.ts b/src/hooks/useHtmlPaste/index.ts index 7d1e9135be34..df0c59855c1b 100644 --- a/src/hooks/useHtmlPaste/index.ts +++ b/src/hooks/useHtmlPaste/index.ts @@ -8,7 +8,16 @@ const insertByCommand = (text: string) => { document.execCommand('insertText', false, text); }; -const insertAtCaret = (target: HTMLElement, text: string) => { +const insertAtCaret = (target: HTMLElement, insertedText: string, maxLength: number) => { + const currentText = target.innerText; + + const availableLength = maxLength - currentText.length; + if (availableLength <= 0) { + return; + } + + const text = insertedText.slice(0, availableLength); + const selection = window.getSelection(); if (selection?.rangeCount) { const range = selection.getRangeAt(0); @@ -28,37 +37,42 @@ const insertAtCaret = (target: HTMLElement, text: string) => { } }; -const useHtmlPaste: UseHtmlPaste = (textInputRef, preHtmlPasteCallback, removeListenerOnScreenBlur = false) => { +const useHtmlPaste: UseHtmlPaste = (textInputRef, preHtmlPasteCallback, removeListenerOnScreenBlur = false, maxLength = CONST.MAX_COMMENT_LENGTH + 1) => { const navigation = useNavigation(); /** * Set pasted text to clipboard * @param {String} text */ - const paste = useCallback((text: string) => { - try { - const textInputHTMLElement = textInputRef.current as HTMLElement; - if (textInputHTMLElement?.hasAttribute('contenteditable')) { - insertAtCaret(textInputHTMLElement, text); - } else { - (textInputRef.current as unknown as HTMLInputElement)?.setRangeText(text, 0, 0, 'end'); - // Trigger the onChange event, which sync the pasted value with the text input state - textInputHTMLElement?.dispatchEvent(new Event('input', {bubbles: true})); - } + const paste = useCallback( + (text: string) => { + try { + const textInputHTMLElement = textInputRef.current as HTMLElement; + if (textInputHTMLElement?.hasAttribute('contenteditable')) { + insertAtCaret(textInputHTMLElement, text, maxLength); + } else { + const htmlInput = textInputRef.current as unknown as HTMLInputElement; + const availableLength = maxLength - (htmlInput.value?.length ?? 0); + htmlInput.setRangeText(text.slice(0, availableLength)); + // Trigger the onChange event, which sync the pasted value with the text input state + textInputHTMLElement?.dispatchEvent(new Event('input', {bubbles: true})); + } - // Pointer will go out of sight when a large paragraph is pasted on the web. Refocusing the input keeps the cursor in view. - // To avoid the keyboard toggle issue in mWeb if using blur() and focus() functions, we just need to dispatch the event to trigger the onFocus handler - // We need to trigger the bubbled "focusin" event to make sure the onFocus handler is triggered - textInputHTMLElement.dispatchEvent( - new FocusEvent('focusin', { - bubbles: true, - }), - ); - // eslint-disable-next-line no-empty - } catch (e) {} - // We only need to set the callback once. - // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps - }, []); + // Pointer will go out of sight when a large paragraph is pasted on the web. Refocusing the input keeps the cursor in view. + // To avoid the keyboard toggle issue in mWeb if using blur() and focus() functions, we just need to dispatch the event to trigger the onFocus handler + // We need to trigger the bubbled "focusin" event to make sure the onFocus handler is triggered + textInputHTMLElement.dispatchEvent( + new FocusEvent('focusin', { + bubbles: true, + }), + ); + // eslint-disable-next-line no-empty + } catch (e) {} + // We only need to set the callback once. + // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps + }, + [maxLength, textInputRef], + ); /** * Manually place the pasted HTML into Composer @@ -67,9 +81,9 @@ const useHtmlPaste: UseHtmlPaste = (textInputRef, preHtmlPasteCallback, removeLi */ const handlePastedHTML = useCallback( (html: string) => { - paste(html.length <= CONST.MAX_MARKUP_LENGTH ? Parser.htmlToMarkdown(html) : html); + paste(Parser.htmlToMarkdown(html.slice(0, maxLength))); }, - [paste], + [paste, maxLength], ); /** diff --git a/src/hooks/useHtmlPaste/types.ts b/src/hooks/useHtmlPaste/types.ts index 305ebe5fbd0f..0aaa12a49ac9 100644 --- a/src/hooks/useHtmlPaste/types.ts +++ b/src/hooks/useHtmlPaste/types.ts @@ -5,6 +5,7 @@ type UseHtmlPaste = ( textInputRef: MutableRefObject<(HTMLTextAreaElement & TextInput) | TextInput | null>, preHtmlPasteCallback?: (event: ClipboardEvent) => boolean, removeListenerOnScreenBlur?: boolean, + maxLength?: number, // Maximum length of the text input value after pasting ) => void; export default UseHtmlPaste; From 2ee4d24dea4b6eb0f203f0d93c4e0b610102b90a Mon Sep 17 00:00:00 2001 From: dominictb Date: Wed, 9 Oct 2024 10:03:54 +0700 Subject: [PATCH 3/8] fix: revert change in CONST.ts --- src/CONST.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/CONST.ts b/src/CONST.ts index f31ef3f97c85..0163cec3e0a5 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -2785,6 +2785,9 @@ const CONST = { // Auth limit is 60k for the column but we store edits and other metadata along the html so let's use a lower limit to accommodate for it. MAX_COMMENT_LENGTH: 10000, + // Use the same value as MAX_COMMENT_LENGTH to ensure the entire comment is parsed. Note that applying markup is very resource-consuming. + MAX_MARKUP_LENGTH: 10000, + MAX_THREAD_REPLIES_PREVIEW: 99, // Character Limits From 3b9a0727a4c83e52b907d0d9118933a7cbd70cf3 Mon Sep 17 00:00:00 2001 From: dominictb Date: Wed, 9 Oct 2024 11:54:26 +0700 Subject: [PATCH 4/8] fix: use textContent in useHtmlPaste to calc paste content --- ios/Podfile.lock | 8 ++++---- src/hooks/useHtmlPaste/index.ts | 17 +++++++++++------ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 5a5c2bb90562..b6d6cd510677 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -2360,7 +2360,7 @@ PODS: - RNGoogleSignin (10.0.1): - GoogleSignIn (~> 7.0) - React-Core - - RNLiveMarkdown (0.1.143): + - RNLiveMarkdown (0.1.168): - DoubleConversion - glog - hermes-engine @@ -2380,9 +2380,9 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - RNLiveMarkdown/common (= 0.1.143) + - RNLiveMarkdown/newarch (= 0.1.168) - Yoga - - RNLiveMarkdown/common (0.1.143): + - RNLiveMarkdown/newarch (0.1.168): - DoubleConversion - glog - hermes-engine @@ -3229,7 +3229,7 @@ SPEC CHECKSUMS: RNFS: 4ac0f0ea233904cb798630b3c077808c06931688 RNGestureHandler: 8781e2529230a1bc3ea8d75e5c3cd071b6c6aed7 RNGoogleSignin: ccaa4a81582cf713eea562c5dd9dc1961a715fd0 - RNLiveMarkdown: e44918843c2638692348f39eafc275698baf0444 + RNLiveMarkdown: 91b821469b0140201f9642d0a48a964f6dd61d13 RNLocalize: d4b8af4e442d4bcca54e68fc687a2129b4d71a81 rnmapbox-maps: 460d6ff97ae49c7d5708c3212c6521697c36a0c4 RNPermissions: 0b1429b55af59d1d08b75a8be2459f65a8ac3f28 diff --git a/src/hooks/useHtmlPaste/index.ts b/src/hooks/useHtmlPaste/index.ts index df0c59855c1b..8b1e06584f64 100644 --- a/src/hooks/useHtmlPaste/index.ts +++ b/src/hooks/useHtmlPaste/index.ts @@ -9,19 +9,26 @@ const insertByCommand = (text: string) => { }; const insertAtCaret = (target: HTMLElement, insertedText: string, maxLength: number) => { - const currentText = target.innerText; + const currentText = target.textContent ?? ''; - const availableLength = maxLength - currentText.length; + let availableLength = maxLength - currentText.length; if (availableLength <= 0) { return; } - const text = insertedText.slice(0, availableLength); + let text = insertedText; const selection = window.getSelection(); if (selection?.rangeCount) { const range = selection.getRangeAt(0); + const selectedText = range.toString(); + availableLength -= selectedText.length; + if (availableLength <= 0) { + return; + } + text = text.slice(0, availableLength); range.deleteContents(); + const node = document.createTextNode(text); range.insertNode(node); @@ -53,9 +60,7 @@ const useHtmlPaste: UseHtmlPaste = (textInputRef, preHtmlPasteCallback, removeLi } else { const htmlInput = textInputRef.current as unknown as HTMLInputElement; const availableLength = maxLength - (htmlInput.value?.length ?? 0); - htmlInput.setRangeText(text.slice(0, availableLength)); - // Trigger the onChange event, which sync the pasted value with the text input state - textInputHTMLElement?.dispatchEvent(new Event('input', {bubbles: true})); + insertByCommand(text.slice(0, availableLength)); } // Pointer will go out of sight when a large paragraph is pasted on the web. Refocusing the input keeps the cursor in view. From 597f13105b07ff1a9adfea4acaf05a92f3c78c70 Mon Sep 17 00:00:00 2001 From: dominictb Date: Fri, 11 Oct 2024 00:18:32 +0700 Subject: [PATCH 5/8] fix: remove document.execCommand in useHtmlPaste --- src/hooks/useHtmlPaste/index.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/hooks/useHtmlPaste/index.ts b/src/hooks/useHtmlPaste/index.ts index 8b1e06584f64..ebffbf1b54b6 100644 --- a/src/hooks/useHtmlPaste/index.ts +++ b/src/hooks/useHtmlPaste/index.ts @@ -4,10 +4,6 @@ import Parser from '@libs/Parser'; import CONST from '@src/CONST'; import type UseHtmlPaste from './types'; -const insertByCommand = (text: string) => { - document.execCommand('insertText', false, text); -}; - const insertAtCaret = (target: HTMLElement, insertedText: string, maxLength: number) => { const currentText = target.textContent ?? ''; @@ -39,8 +35,6 @@ const insertAtCaret = (target: HTMLElement, insertedText: string, maxLength: num // Dispatch input event to trigger Markdown Input to parse the new text target.dispatchEvent(new Event('input', {bubbles: true})); - } else { - insertByCommand(text); } }; @@ -60,7 +54,7 @@ const useHtmlPaste: UseHtmlPaste = (textInputRef, preHtmlPasteCallback, removeLi } else { const htmlInput = textInputRef.current as unknown as HTMLInputElement; const availableLength = maxLength - (htmlInput.value?.length ?? 0); - insertByCommand(text.slice(0, availableLength)); + htmlInput.setRangeText(text.slice(0, availableLength)); } // Pointer will go out of sight when a large paragraph is pasted on the web. Refocusing the input keeps the cursor in view. From 3ccb6d451fd98f532903b97a18bdd06e55e29bd1 Mon Sep 17 00:00:00 2001 From: dominictb Date: Thu, 14 Nov 2024 12:11:01 +0700 Subject: [PATCH 6/8] chore: update rn live md to 0.1.184 --- ios/Podfile.lock | 42 ++++++++++++++++++++++++++++++++---------- package-lock.json | 8 ++++---- package.json | 2 +- 3 files changed, 37 insertions(+), 15 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 6efc4d1a5eff..b40b1adf4193 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -2391,7 +2391,7 @@ PODS: - RNGoogleSignin (10.0.1): - GoogleSignIn (~> 7.0) - React-Core - - RNLiveMarkdown (0.1.183): + - RNLiveMarkdown (0.1.184): - DoubleConversion - glog - hermes-engine @@ -2411,9 +2411,9 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - RNLiveMarkdown/newarch (= 0.1.183) + - RNLiveMarkdown/newarch (= 0.1.184) - Yoga - - RNLiveMarkdown/newarch (0.1.183): + - RNLiveMarkdown/newarch (0.1.184): - DoubleConversion - glog - hermes-engine @@ -2503,7 +2503,7 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - RNReanimated (3.15.3): + - RNReanimated (3.16.1): - DoubleConversion - glog - hermes-engine @@ -2523,10 +2523,10 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - RNReanimated/reanimated (= 3.15.3) - - RNReanimated/worklets (= 3.15.3) + - RNReanimated/reanimated (= 3.16.1) + - RNReanimated/worklets (= 3.16.1) - Yoga - - RNReanimated/reanimated (3.15.3): + - RNReanimated/reanimated (3.16.1): - DoubleConversion - glog - hermes-engine @@ -2546,8 +2546,30 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core + - RNReanimated/reanimated/apple (= 3.16.1) - Yoga - - RNReanimated/worklets (3.15.3): + - RNReanimated/reanimated/apple (3.16.1): + - DoubleConversion + - glog + - hermes-engine + - RCT-Folly (= 2024.01.01.00) + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-NativeModulesApple + - React-RCTFabric + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - Yoga + - RNReanimated/worklets (3.16.1): - DoubleConversion - glog - hermes-engine @@ -3264,12 +3286,12 @@ SPEC CHECKSUMS: RNFS: 4ac0f0ea233904cb798630b3c077808c06931688 RNGestureHandler: 8781e2529230a1bc3ea8d75e5c3cd071b6c6aed7 RNGoogleSignin: ccaa4a81582cf713eea562c5dd9dc1961a715fd0 - RNLiveMarkdown: fa9c6451960d09209bb5698745a0a66330ec53cc + RNLiveMarkdown: d5a311813de4429b9f18e764badc5bd7923cbaea RNLocalize: d4b8af4e442d4bcca54e68fc687a2129b4d71a81 rnmapbox-maps: 460d6ff97ae49c7d5708c3212c6521697c36a0c4 RNPermissions: 0b1429b55af59d1d08b75a8be2459f65a8ac3f28 RNReactNativeHapticFeedback: 73756a3477a5a622fa16862a3ab0d0fc5e5edff5 - RNReanimated: f46df3b08d5d59cd83c47bb6697ce88e565e0dc7 + RNReanimated: 2d728bad3a69119be89c3431ee0ccda026ecffdc RNScreens: de6e57426ba0e6cbc3fb5b4f496e7f08cb2773c2 RNShare: bd4fe9b95d1ee89a200778cc0753ebe650154bb0 RNSound: 6c156f925295bdc83e8e422e7d8b38d33bc71852 diff --git a/package-lock.json b/package-lock.json index fffe0be3b477..ca560a3e4ae3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "license": "MIT", "dependencies": { "@dotlottie/react-player": "^1.6.3", - "@expensify/react-native-live-markdown": "0.1.183", + "@expensify/react-native-live-markdown": "0.1.184", "@expo/metro-runtime": "~3.2.3", "@firebase/app": "^0.10.10", "@firebase/performance": "^0.6.8", @@ -3631,9 +3631,9 @@ } }, "node_modules/@expensify/react-native-live-markdown": { - "version": "0.1.183", - "resolved": "https://registry.npmjs.org/@expensify/react-native-live-markdown/-/react-native-live-markdown-0.1.183.tgz", - "integrity": "sha512-egxknos7ghe4M5Z2rK7DvphcaxQBdxyppu5N2tdCVc/3oPO2ZtBNjDjtksqywC12wPtIYgHSgxrzvLEfbh5skw==", + "version": "0.1.184", + "resolved": "https://registry.npmjs.org/@expensify/react-native-live-markdown/-/react-native-live-markdown-0.1.184.tgz", + "integrity": "sha512-HGr3HPJ/gDDqewk30I2OHl/ZKrBKqDnWlsxKiAXhi4NkZeZglW/FcdLkNOQ9MYzGPui2FQ/RRHz2eblIhbaftg==", "license": "MIT", "workspaces": [ "parser", diff --git a/package.json b/package.json index f9fe15eadf93..35ae4b8c64d9 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ }, "dependencies": { "@dotlottie/react-player": "^1.6.3", - "@expensify/react-native-live-markdown": "0.1.183", + "@expensify/react-native-live-markdown": "0.1.184", "@expo/metro-runtime": "~3.2.3", "@firebase/app": "^0.10.10", "@firebase/performance": "^0.6.8", From 46f4b5fa3c845e190b4d9f9613629581de89d625 Mon Sep 17 00:00:00 2001 From: dominictb Date: Tue, 3 Dec 2024 14:25:11 +0700 Subject: [PATCH 7/8] resolve conflict --- package-lock.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3e591a26e121..c58f911c246e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3503,15 +3503,9 @@ } }, "node_modules/@expensify/react-native-live-markdown": { -<<<<<<< HEAD - "version": "0.1.184", - "resolved": "https://registry.npmjs.org/@expensify/react-native-live-markdown/-/react-native-live-markdown-0.1.184.tgz", - "integrity": "sha512-HGr3HPJ/gDDqewk30I2OHl/ZKrBKqDnWlsxKiAXhi4NkZeZglW/FcdLkNOQ9MYzGPui2FQ/RRHz2eblIhbaftg==", -======= "version": "0.1.187", "resolved": "https://registry.npmjs.org/@expensify/react-native-live-markdown/-/react-native-live-markdown-0.1.187.tgz", "integrity": "sha512-bw+dfhRN31u2xfG8LCI3e28g5EG/BfkyX1EqjPBRQlDZo4fZsdA61UFW6P8Y4rHlqspjYXJ0vk4ctECRWYl4Yg==", ->>>>>>> main "license": "MIT", "workspaces": [ "./parser", From 6d245d7eb6697f94cebaeb6e0536d5319e783531 Mon Sep 17 00:00:00 2001 From: dominictb Date: Thu, 12 Dec 2024 15:45:02 +0700 Subject: [PATCH 8/8] merge comments --- src/components/RNMarkdownTextInput.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/RNMarkdownTextInput.tsx b/src/components/RNMarkdownTextInput.tsx index 8101dd990641..11f8a852dbcf 100644 --- a/src/components/RNMarkdownTextInput.tsx +++ b/src/components/RNMarkdownTextInput.tsx @@ -30,7 +30,6 @@ function RNMarkdownTextInputWithRef({maxLength, ...props}: MarkdownTextInputProp {...props} /** * If maxLength is not set, we should set the it to CONST.MAX_COMMENT_LENGTH + 1, to avoid parsing markdown for large text - * Since we want the ExceededCommentLength to be displayed, we need to set the maxLength to CONST.MAX_COMMENT_LENGTH + 1 */ maxLength={maxLength ?? CONST.MAX_COMMENT_LENGTH + 1} />