@@ -11,6 +11,7 @@ import {
1111 TextInputContentSizeChangeEventData ,
1212 Platform ,
1313 KeyboardTypeOptions ,
14+ ReturnKeyTypeOptions ,
1415} from 'react-native' ;
1516import React , {
1617 forwardRef ,
@@ -53,13 +54,14 @@ interface INativeProps {
5354 e : NativeSyntheticEvent < TextInputContentSizeChangeEventData >
5455 ) => void ;
5556 keyboardType ?: KeyboardTypeOptions | undefined ;
56- onSubmitEditing ?: ( text : string ) => void ;
57- onAndroidSubmitEditing ?: ( text : string ) => void ;
57+ onSubmitEditing ?: ( e : NativeSyntheticEvent < TextInputChangeEventData > ) => void ;
58+ onAndroidSubmitEditing ?: ( e : IVTTextInputData ) => void ;
5859 submitBehavior ?: 'submit' ;
5960 onBlur ?: ( ) => void ;
6061 onFocus ?: ( ) => void ;
6162 onAndroidFocus ?: ( ) => void ;
6263 onAndroidBlur ?: ( ) => void ;
64+ returnKeyType ?: ReturnKeyTypeOptions | undefined ;
6365}
6466interface IProps {
6567 style ?: StyleProp < TextStyle > | undefined ;
@@ -84,6 +86,7 @@ interface IProps {
8486 onMention ?: ( data : IonMentionData ) => void ;
8587 onBlur ?: ( ) => void ;
8688 onFocus ?: ( ) => void ;
89+ returnKeyType ?: ReturnKeyTypeOptions | undefined ;
8790}
8891export type IATTextViewRef = React . ForwardedRef < IATTextViewBase > ;
8992
@@ -236,7 +239,14 @@ const VariableTextInputView = forwardRef(
236239 insertMentionAndDelateKeyword : insertMentionAndDelateKeyword ,
237240 } ;
238241 } ) ;
239- const onAndroidSubmitEditing = ( ) => { } ;
242+ const _onSubmitEditing = (
243+ e : NativeSyntheticEvent < TextInputChangeEventData >
244+ ) => {
245+ props . onSubmitEditing && props . onSubmitEditing ( e . nativeEvent . text ) ;
246+ } ;
247+ const onAndroidSubmitEditing = ( e : IVTTextInputData ) => {
248+ props . onSubmitEditing && props . onSubmitEditing ( e . nativeEvent . text ) ;
249+ } ;
240250 const onAndroidTextInput = ( e : IVTTextInputData ) => {
241251 props . onTextInput && props . onTextInput ( e ) ;
242252 } ;
@@ -249,6 +259,7 @@ const VariableTextInputView = forwardRef(
249259 onAndroidChange = { _onChange }
250260 onAndroidContentSizeChange = { onContentSizeChange }
251261 { ...props }
262+ onSubmitEditing = { _onSubmitEditing }
252263 onAndroidSubmitEditing = { onAndroidSubmitEditing }
253264 onAndroidTextInput = { onAndroidTextInput }
254265 onAndroidBlur = { props . onBlur }
0 commit comments