ios – Cannot press TouchableOpacity when keyboard is up. I have to double press it. React Native

[ad_1]

I’m making a feedback part for my app with React-Native and constructing for ios. When the keyboard is as much as put up a remark I am unable to immedietley press the TouchableOpacity button that submits the put up. I have to first press it to shut the keyboard then press once more to submit.

const CommentCreation = React.forwardRef((props, ref) => {
    
    return (
        <View type={commentCreationStyles.container} >
            <TextInput
                worth={props.message}
                ref={ref}
                type={commentCreationStyles.enter}
                onChangeText={val => props.setMessage(val)}
                autoFocus={false}
                multiline={true}
                returnKeyType={'subsequent'}
                placeholder={'Enter Your Remark'}
                numberOfLines={5}
                replyBool={props.replyBool}
            />
            <TouchableOpacity
                type={commentCreationStyles.submitButton}
                onPress={props.addCommentEnabled ? () => {props.addComment(); Keyboard.dismiss()} : null}
            >
                <Ionicons title="ios-send" dimension={36} colour="#D7D7D7" />
            </TouchableOpacity>
        </View>
    )
})

My app

I’ve tried keyboardShouldPersistTaps=”dealt with” and its variations at the side of ScrollView along with View and changing View. I’ve tried these on all ranges of the tree. I am at a loss, any assistance is enormously appreciated!

[ad_2]

Leave a Reply