From 28e8c36516d9c54fa0c83bc851c95ee68c9f6d1b Mon Sep 17 00:00:00 2001 From: daledah Date: Thu, 30 Oct 2025 01:53:20 +0700 Subject: [PATCH 1/6] remove blurOnSubmit --- .../EmojiPicker/EmojiPickerMenu/index.native.tsx | 2 +- src/components/EmojiPicker/EmojiPickerMenu/index.tsx | 2 +- src/components/Form/InputWrapper.tsx | 12 ++++++------ src/components/Form/types.ts | 2 +- src/pages/signin/LoginForm/BaseLoginForm.tsx | 6 +++--- src/pages/signin/LoginForm/types.ts | 2 +- src/pages/signin/SignInPage.tsx | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/components/EmojiPicker/EmojiPickerMenu/index.native.tsx b/src/components/EmojiPicker/EmojiPickerMenu/index.native.tsx index 9f71caa5032a6..989c9bc0b238a 100644 --- a/src/components/EmojiPicker/EmojiPickerMenu/index.native.tsx +++ b/src/components/EmojiPicker/EmojiPickerMenu/index.native.tsx @@ -125,7 +125,7 @@ function EmojiPickerMenu({onEmojiSelected, activeEmoji, ref}: EmojiPickerMenuPro accessibilityLabel={translate('common.search')} role={CONST.ROLE.PRESENTATION} onChangeText={filterEmojis} - blurOnSubmit={filteredEmojis.length > 0} + submitBehavior={filteredEmojis.length > 0 ? 'blurAndSubmit' : 'submit'} /> setIsFocused(false)} autoCorrect={false} - blurOnSubmit={filteredEmojis.length > 0} + submitBehavior={filteredEmojis.length > 0 ? 'blurAndSubmit' : 'submit'} /> ({ const {InputComponent, inputID, valueType = 'string', shouldSubmitForm: propShouldSubmitForm, ...rest} = props as InputComponentBaseProps; const {registerInput} = useContext(FormContext); - const {shouldSetTouchedOnBlurOnly, blurOnSubmit, shouldSubmitForm} = computeComponentSpecificRegistrationParams(props as InputComponentBaseProps); + const {shouldSetTouchedOnBlurOnly, submitBehavior, shouldSubmitForm} = computeComponentSpecificRegistrationParams(props as InputComponentBaseProps); // eslint-disable-next-line react-compiler/react-compiler - const {key, ...registerInputProps} = registerInput(inputID, shouldSubmitForm, {ref, valueType, ...rest, shouldSetTouchedOnBlurOnly, blurOnSubmit}); + const {key, ...registerInputProps} = registerInput(inputID, shouldSubmitForm, {ref, valueType, ...rest, shouldSetTouchedOnBlurOnly, submitBehavior}); return ( = Input ref?: Ref; multiline?: boolean; autoGrowHeight?: boolean; - blurOnSubmit?: boolean; + submitBehavior?: 'submit' | 'blurAndSubmit' | 'newline'; shouldSubmitForm?: boolean; uncontrolled?: boolean; }; diff --git a/src/pages/signin/LoginForm/BaseLoginForm.tsx b/src/pages/signin/LoginForm/BaseLoginForm.tsx index ed15a760907b6..a0f3480fc58ab 100644 --- a/src/pages/signin/LoginForm/BaseLoginForm.tsx +++ b/src/pages/signin/LoginForm/BaseLoginForm.tsx @@ -40,7 +40,7 @@ import type LoginFormProps from './types'; type BaseLoginFormProps = WithToggleVisibilityViewProps & LoginFormProps; -function BaseLoginForm({blurOnSubmit = false, isVisible, ref}: BaseLoginFormProps) { +function BaseLoginForm({submitBehavior = 'submit', isVisible, ref}: BaseLoginFormProps) { const {login, setLogin} = useLogin(); const [account] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: true}); const [closeAccount] = useOnyx(ONYXKEYS.FORMS.CLOSE_ACCOUNT_FORM, {canBeMissing: true}); @@ -175,7 +175,7 @@ function BaseLoginForm({blurOnSubmit = false, isVisible, ref}: BaseLoginFormProp }, [account?.isLoading]); useEffect(() => { - if (blurOnSubmit) { + if (submitBehavior === 'blurAndSubmit') { input.current?.blur(); } @@ -184,7 +184,7 @@ function BaseLoginForm({blurOnSubmit = false, isVisible, ref}: BaseLoginFormProp return; } input.current?.focus(); - }, [blurOnSubmit, isVisible, prevIsVisible]); + }, [submitBehavior, isVisible, prevIsVisible]); useImperativeHandle(ref, () => ({ isInputFocused() { diff --git a/src/pages/signin/LoginForm/types.ts b/src/pages/signin/LoginForm/types.ts index 679c32834250b..be72696e837b8 100644 --- a/src/pages/signin/LoginForm/types.ts +++ b/src/pages/signin/LoginForm/types.ts @@ -5,7 +5,7 @@ type LoginFormProps = { scrollPageToTop?: () => void; /** Should we dismiss the keyboard when transitioning away from the page? */ - blurOnSubmit?: boolean; + submitBehavior?: 'submit' | 'blurAndSubmit' | 'newline'; /** Whether the content is visible. */ isVisible: boolean; diff --git a/src/pages/signin/SignInPage.tsx b/src/pages/signin/SignInPage.tsx index e7f9123334e4b..456a202b733fb 100644 --- a/src/pages/signin/SignInPage.tsx +++ b/src/pages/signin/SignInPage.tsx @@ -314,7 +314,7 @@ function SignInPage({ref}: SignInPageProps) { From 05f4b67db17ad95dba99635d50025c06e2a982ed Mon Sep 17 00:00:00 2001 From: daledah Date: Tue, 11 Nov 2025 23:37:18 +0700 Subject: [PATCH 2/6] get type from react-native --- src/components/Form/InputWrapper.tsx | 3 ++- src/components/Form/types.ts | 4 ++-- src/pages/signin/LoginForm/types.ts | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/Form/InputWrapper.tsx b/src/components/Form/InputWrapper.tsx index 52326b22d6943..585544beed474 100644 --- a/src/components/Form/InputWrapper.tsx +++ b/src/components/Form/InputWrapper.tsx @@ -1,4 +1,5 @@ import type {ComponentPropsWithoutRef, ComponentType, ForwardedRef} from 'react'; +import type {SubmitBehavior} from 'react-native'; import React, {useContext} from 'react'; import type {AnimatedTextInputRef} from '@components/RNTextInput'; import RoomNameInput from '@components/RoomNameInput'; @@ -17,7 +18,7 @@ const textInputBasedComponents: TextInputBasedComponents = new Set([TextInput, R type ComputedComponentSpecificRegistrationParams = { shouldSubmitForm: boolean; shouldSetTouchedOnBlurOnly: boolean; - submitBehavior: 'submit' | 'blurAndSubmit' | 'newline' | undefined; + submitBehavior?: SubmitBehavior; }; function computeComponentSpecificRegistrationParams({ diff --git a/src/components/Form/types.ts b/src/components/Form/types.ts index 7399f369fcb6e..386c05254ad80 100644 --- a/src/components/Form/types.ts +++ b/src/components/Form/types.ts @@ -1,5 +1,5 @@ import type {ComponentType, FocusEvent, Key, ReactNode, Ref, RefObject} from 'react'; -import type {GestureResponderEvent, StyleProp, TextInputSubmitEditingEvent, ViewStyle} from 'react-native'; +import type {GestureResponderEvent, StyleProp, SubmitBehavior, TextInputSubmitEditingEvent, ViewStyle} from 'react-native'; import type {ValueOf} from 'type-fest'; import type AddPlaidBankAccount from '@components/AddPlaidBankAccount'; import type AddressSearch from '@components/AddressSearch'; @@ -121,7 +121,7 @@ type InputComponentBaseProps = Input ref?: Ref; multiline?: boolean; autoGrowHeight?: boolean; - submitBehavior?: 'submit' | 'blurAndSubmit' | 'newline'; + submitBehavior?: SubmitBehavior; shouldSubmitForm?: boolean; uncontrolled?: boolean; }; diff --git a/src/pages/signin/LoginForm/types.ts b/src/pages/signin/LoginForm/types.ts index be72696e837b8..e9fbe6f74c861 100644 --- a/src/pages/signin/LoginForm/types.ts +++ b/src/pages/signin/LoginForm/types.ts @@ -1,11 +1,12 @@ import type {ForwardedRef} from 'react'; +import type {SubmitBehavior} from 'react-native'; type LoginFormProps = { /** Function used to scroll to the top of the page */ scrollPageToTop?: () => void; /** Should we dismiss the keyboard when transitioning away from the page? */ - submitBehavior?: 'submit' | 'blurAndSubmit' | 'newline'; + submitBehavior?: SubmitBehavior; /** Whether the content is visible. */ isVisible: boolean; From 12f58d896e5758e2fbbbe000ef7ef202c6c19630 Mon Sep 17 00:00:00 2001 From: daledah Date: Tue, 11 Nov 2025 23:55:13 +0700 Subject: [PATCH 3/6] fix prettier --- src/components/Form/InputWrapper.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Form/InputWrapper.tsx b/src/components/Form/InputWrapper.tsx index 585544beed474..179dcee4d0c22 100644 --- a/src/components/Form/InputWrapper.tsx +++ b/src/components/Form/InputWrapper.tsx @@ -1,6 +1,6 @@ import type {ComponentPropsWithoutRef, ComponentType, ForwardedRef} from 'react'; -import type {SubmitBehavior} from 'react-native'; import React, {useContext} from 'react'; +import type {SubmitBehavior} from 'react-native'; import type {AnimatedTextInputRef} from '@components/RNTextInput'; import RoomNameInput from '@components/RoomNameInput'; import type RoomNameInputProps from '@components/RoomNameInput/types'; From aed3b5621b8d7a0778692be4ffc44e4dc7b56e88 Mon Sep 17 00:00:00 2001 From: daledah Date: Tue, 16 Dec 2025 23:30:40 +0700 Subject: [PATCH 4/6] add patch to fix submitBehavior in web --- patches/react-native-web/details.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/patches/react-native-web/details.md b/patches/react-native-web/details.md index 8c7df48f3ea27..ee7282178fc28 100644 --- a/patches/react-native-web/details.md +++ b/patches/react-native-web/details.md @@ -130,4 +130,19 @@ - Upstream PR/issue: This was a patch on top of patches 008 and 009 of react-native-web. - E/App issue: https://github.com/Expensify/App/issues/66821 -- PR introducing patch: https://github.com/Expensify/App/pull/69820 \ No newline at end of file +- PR introducing patch: https://github.com/Expensify/App/pull/69820 + +### [react-native-web+0.21.2+012+submitBehavior-support.patch](react-native-web+0.21.2+012+submitBehavior-support.patch) + +- Reason: + ``` + Adds support for the `submitBehavior` prop in TextInput component for web. + React Native deprecated `blurOnSubmit` in favor of `submitBehavior` (React Native 0.73+), + but React Native Web doesn't natively support this prop. This patch implements the web + equivalent behavior, mapping `submitBehavior` values ('submit', 'blurAndSubmit', 'newline') + to the appropriate keyboard handling logic while maintaining backwards compatibility with + the deprecated `blurOnSubmit` prop. + ``` +- Upstream PR/issue: https://github.com/necolas/react-native-web/issues/2817 +- E/App issue: https://github.com/Expensify/App/issues/73782 +- PR introducing patch: https://github.com/Expensify/App/pull/76332 \ No newline at end of file From 007c95ce90c29d8ea35b7c588458a1855cf0c95f Mon Sep 17 00:00:00 2001 From: daledah Date: Tue, 16 Dec 2025 23:30:56 +0700 Subject: [PATCH 5/6] add missing patch --- ...y+react-native-live-markdown+0.1.317.patch | 118 ++++++++++++++++++ .../react-native-live-markdown/details.md | 18 +++ ...eb+0.21.2+012+submitBehavior-support.patch | 46 +++++++ 3 files changed, 182 insertions(+) create mode 100644 patches/@expensify/react-native-live-markdown/@expensify+react-native-live-markdown+0.1.317.patch create mode 100644 patches/@expensify/react-native-live-markdown/details.md create mode 100644 patches/react-native-web/react-native-web+0.21.2+012+submitBehavior-support.patch diff --git a/patches/@expensify/react-native-live-markdown/@expensify+react-native-live-markdown+0.1.317.patch b/patches/@expensify/react-native-live-markdown/@expensify+react-native-live-markdown+0.1.317.patch new file mode 100644 index 0000000000000..ab04f92db7f20 --- /dev/null +++ b/patches/@expensify/react-native-live-markdown/@expensify+react-native-live-markdown+0.1.317.patch @@ -0,0 +1,118 @@ +diff --git a/node_modules/@expensify/react-native-live-markdown/lib/module/MarkdownTextInput.web.js b/node_modules/@expensify/react-native-live-markdown/lib/module/MarkdownTextInput.web.js +index e36195f..3a3ae72 100644 +--- a/node_modules/@expensify/react-native-live-markdown/lib/module/MarkdownTextInput.web.js ++++ b/node_modules/@expensify/react-native-live-markdown/lib/module/MarkdownTextInput.web.js +@@ -21,6 +21,7 @@ const MarkdownTextInput = /*#__PURE__*/React.forwardRef(({ + autoCapitalize = 'sentences', + autoCorrect = true, + blurOnSubmit = false, ++ submitBehavior, + caretHidden, + clearTextOnFocus, + dir = 'auto', +@@ -359,8 +360,19 @@ const MarkdownTextInput = /*#__PURE__*/React.forwardRef(({ + handleOnChangeText(e); + return; + } +- const blurOnSubmitDefault = !multiline; +- const shouldBlurOnSubmit = blurOnSubmit === null ? blurOnSubmitDefault : blurOnSubmit; ++ // Support submitBehavior prop (React Native 0.73+), fallback to blurOnSubmit for backwards compatibility ++ let shouldBlurOnSubmit; ++ let shouldSubmit; ++ if (submitBehavior != null) { ++ // submitBehavior takes precedence over blurOnSubmit ++ shouldSubmit = submitBehavior === 'submit' || submitBehavior === 'blurAndSubmit'; ++ shouldBlurOnSubmit = submitBehavior === 'blurAndSubmit'; ++ } else { ++ // Fallback to blurOnSubmit logic for backwards compatibility ++ const blurOnSubmitDefault = !multiline; ++ shouldBlurOnSubmit = blurOnSubmit === null ? blurOnSubmitDefault : blurOnSubmit; ++ shouldSubmit = blurOnSubmit || !multiline; ++ } + const nativeEvent = e.nativeEvent; + const isComposing = isEventComposing(nativeEvent); + const event = e; +@@ -373,18 +385,19 @@ const MarkdownTextInput = /*#__PURE__*/React.forwardRef(({ + !isComposing && !e.isDefaultPrevented()) { + // prevent "Enter" from inserting a newline or submitting a form + e.preventDefault(); +- if (!e.shiftKey && (blurOnSubmit || !multiline) && onSubmitEditing) { ++ // submitBehavior === 'newline' means don't submit, just insert newline (default behavior) ++ if (!e.shiftKey && shouldSubmit && onSubmitEditing) { + onSubmitEditing(event); +- } else if (multiline) { ++ } else if (multiline && (!shouldSubmit || e.shiftKey)) { + // We need to change normal behavior of "Enter" key to insert a line breaks, to prevent wrapping contentEditable text in
tags. + // Thanks to that in every situation we have proper amount of new lines in our parsed text. Without it pressing enter in empty lines will add 2 more new lines. + insertText(e, '\n'); + } +- if (!e.shiftKey && (shouldBlurOnSubmit && hostNode !== null || !multiline)) { ++ if (!e.shiftKey && shouldBlurOnSubmit && hostNode !== null) { + setTimeout(() => divRef.current && divRef.current.blur(), 0); + } + } +- }, [multiline, blurOnSubmit, setEventProps, onKeyPress, handleOnChangeText, onSubmitEditing, insertText]); ++ }, [multiline, blurOnSubmit, submitBehavior, setEventProps, onKeyPress, handleOnChangeText, onSubmitEditing, insertText]); + const handleFocus = useCallback(event => { + hasJustBeenFocused.current = true; + const e = event; +diff --git a/node_modules/@expensify/react-native-live-markdown/src/MarkdownTextInput.web.tsx b/node_modules/@expensify/react-native-live-markdown/src/MarkdownTextInput.web.tsx +index fa3283d..59f02c6 100644 +--- a/node_modules/@expensify/react-native-live-markdown/src/MarkdownTextInput.web.tsx ++++ b/node_modules/@expensify/react-native-live-markdown/src/MarkdownTextInput.web.tsx +@@ -87,6 +87,7 @@ const MarkdownTextInput = React.forwardRef); +- } else if (multiline) { ++ } else if (multiline && (!shouldSubmit || e.shiftKey)) { + // We need to change normal behavior of "Enter" key to insert a line breaks, to prevent wrapping contentEditable text in
tags. + // Thanks to that in every situation we have proper amount of new lines in our parsed text. Without it pressing enter in empty lines will add 2 more new lines. + insertText(e, '\n'); + } +- if (!e.shiftKey && ((shouldBlurOnSubmit && hostNode !== null) || !multiline)) { ++ if (!e.shiftKey && shouldBlurOnSubmit && hostNode !== null) { + setTimeout(() => divRef.current && divRef.current.blur(), 0); + } + } + }, +- [multiline, blurOnSubmit, setEventProps, onKeyPress, handleOnChangeText, onSubmitEditing, insertText], ++ [multiline, blurOnSubmit, submitBehavior, setEventProps, onKeyPress, handleOnChangeText, onSubmitEditing, insertText], + ); + + const handleFocus: FocusEventHandler = useCallback( diff --git a/patches/@expensify/react-native-live-markdown/details.md b/patches/@expensify/react-native-live-markdown/details.md new file mode 100644 index 0000000000000..6a7cbf31d75a9 --- /dev/null +++ b/patches/@expensify/react-native-live-markdown/details.md @@ -0,0 +1,18 @@ +# # `react-native-live-markdown` patches + +### [@expensify+react-native-live-markdown+0.1.317.patch](@expensify+react-native-live-markdown+0.1.317.patch) + +- Reason: + ``` + Adds support for the `submitBehavior` prop in MarkdownTextInput component for web. + React Native deprecated `blurOnSubmit` in favor of `submitBehavior` (React Native 0.73+), + but @expensify/react-native-live-markdown's MarkdownTextInput on web doesn't natively + support this prop. This patch implements the web equivalent behavior, mapping + `submitBehavior` values ('submit', 'blurAndSubmit', 'newline') to the appropriate + keyboard handling logic in handleKeyPress while maintaining backwards compatibility with + the deprecated `blurOnSubmit` prop. This aligns MarkdownTextInput with React Native's + TextInput API and react-native-web's TextInput implementation. + ``` +- Upstream PR/issue: https://github.com/Expensify/react-native-live-markdown/issues/744 +- E/App issue: https://github.com/Expensify/App/issues/73782 +- PR introducing patch: https://github.com/Expensify/App/pull/76332 \ No newline at end of file diff --git a/patches/react-native-web/react-native-web+0.21.2+012+submitBehavior-support.patch b/patches/react-native-web/react-native-web+0.21.2+012+submitBehavior-support.patch new file mode 100644 index 0000000000000..126da7aa3f85c --- /dev/null +++ b/patches/react-native-web/react-native-web+0.21.2+012+submitBehavior-support.patch @@ -0,0 +1,46 @@ +diff --git a/node_modules/react-native-web/dist/exports/TextInput/index.js b/node_modules/react-native-web/dist/exports/TextInput/index.js +index 0f476a7..6fab5b0 100644 +--- a/node_modules/react-native-web/dist/exports/TextInput/index.js ++++ b/node_modules/react-native-web/dist/exports/TextInput/index.js +@@ -89,6 +89,7 @@ var TextInput = /*#__PURE__*/React.forwardRef((props, forwardedRef) => { + _props$autoCorrect = props.autoCorrect, + autoCorrect = _props$autoCorrect === void 0 ? true : _props$autoCorrect, + blurOnSubmit = props.blurOnSubmit, ++ submitBehavior = props.submitBehavior, + caretHidden = props.caretHidden, + clearTextOnFocus = props.clearTextOnFocus, + dir = props.dir, +@@ -276,9 +277,23 @@ var TextInput = /*#__PURE__*/React.forwardRef((props, forwardedRef) => { + function handleKeyDown(e) { + var hostNode = e.target; + // Prevent key events bubbling (see #612) + e.stopPropagation(); +- var blurOnSubmitDefault = !multiline; +- var shouldBlurOnSubmit = blurOnSubmit == null ? blurOnSubmitDefault : blurOnSubmit; ++ // Support submitBehavior prop (React Native 0.73+), fallback to blurOnSubmit for backwards compatibility ++ var shouldBlurOnSubmit; ++ var shouldSubmit; ++ if (submitBehavior != null) { ++ // submitBehavior takes precedence over blurOnSubmit ++ shouldSubmit = submitBehavior === 'submit' || submitBehavior === 'blurAndSubmit'; ++ shouldBlurOnSubmit = submitBehavior === 'blurAndSubmit'; ++ } else { ++ // Fallback to blurOnSubmit logic for backwards compatibility ++ var blurOnSubmitDefault = !multiline; ++ shouldBlurOnSubmit = blurOnSubmit == null ? blurOnSubmitDefault : blurOnSubmit; ++ shouldSubmit = blurOnSubmit || !multiline; ++ } + var nativeEvent = e.nativeEvent; + var isComposing = isEventComposing(nativeEvent); + if (onKeyPress) { +@@ -287,7 +302,8 @@ var TextInput = /*#__PURE__*/React.forwardRef((props, forwardedRef) => { + if (e.key === 'Enter' && !e.shiftKey && + // Do not call submit if composition is occuring. + !isComposing && !e.isDefaultPrevented()) { +- if ((blurOnSubmit || !multiline) && onSubmitEditing) { ++ // submitBehavior === 'newline' means don't submit, just insert newline (default behavior) ++ if (shouldSubmit && onSubmitEditing) { + // prevent "Enter" from inserting a newline or submitting a form + e.preventDefault(); + nativeEvent.text = e.target.value; + From 9832267bac48cc5e4d99619cc98e59fefeb9b15f Mon Sep 17 00:00:00 2001 From: daledah Date: Wed, 17 Dec 2025 00:39:08 +0700 Subject: [PATCH 6/6] fix lint --- ...ative-web+0.21.2+012+submitBehavior-support.patch | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/patches/react-native-web/react-native-web+0.21.2+012+submitBehavior-support.patch b/patches/react-native-web/react-native-web+0.21.2+012+submitBehavior-support.patch index 126da7aa3f85c..c62903bebe1ce 100644 --- a/patches/react-native-web/react-native-web+0.21.2+012+submitBehavior-support.patch +++ b/patches/react-native-web/react-native-web+0.21.2+012+submitBehavior-support.patch @@ -1,8 +1,8 @@ diff --git a/node_modules/react-native-web/dist/exports/TextInput/index.js b/node_modules/react-native-web/dist/exports/TextInput/index.js -index 0f476a7..6fab5b0 100644 +index 0f476a7..51555b5 100644 --- a/node_modules/react-native-web/dist/exports/TextInput/index.js +++ b/node_modules/react-native-web/dist/exports/TextInput/index.js -@@ -89,6 +89,7 @@ var TextInput = /*#__PURE__*/React.forwardRef((props, forwardedRef) => { +@@ -84,6 +89,7 @@ var TextInput = /*#__PURE__*/React.forwardRef((props, forwardedRef) => { _props$autoCorrect = props.autoCorrect, autoCorrect = _props$autoCorrect === void 0 ? true : _props$autoCorrect, blurOnSubmit = props.blurOnSubmit, @@ -10,8 +10,7 @@ index 0f476a7..6fab5b0 100644 caretHidden = props.caretHidden, clearTextOnFocus = props.clearTextOnFocus, dir = props.dir, -@@ -276,9 +277,23 @@ var TextInput = /*#__PURE__*/React.forwardRef((props, forwardedRef) => { - function handleKeyDown(e) { +@@ -271,8 +277,19 @@ var TextInput = /*#__PURE__*/React.forwardRef((props, forwardedRef) => { var hostNode = e.target; // Prevent key events bubbling (see #612) e.stopPropagation(); @@ -33,7 +32,7 @@ index 0f476a7..6fab5b0 100644 var nativeEvent = e.nativeEvent; var isComposing = isEventComposing(nativeEvent); if (onKeyPress) { -@@ -287,7 +302,8 @@ var TextInput = /*#__PURE__*/React.forwardRef((props, forwardedRef) => { +@@ -281,7 +298,8 @@ var TextInput = /*#__PURE__*/React.forwardRef((props, forwardedRef) => { if (e.key === 'Enter' && !e.shiftKey && // Do not call submit if composition is occuring. !isComposing && !e.isDefaultPrevented()) { @@ -42,5 +41,4 @@ index 0f476a7..6fab5b0 100644 + if (shouldSubmit && onSubmitEditing) { // prevent "Enter" from inserting a newline or submitting a form e.preventDefault(); - nativeEvent.text = e.target.value; - + nativeEvent.text = e.target.value; \ No newline at end of file