I am using TextInput of react-native-paper
on IOS. I want to use preventDefault
for button Enter
, Tab
, ,
buttons but I can't find the preventDefault
method for react-native
. Is there a preventDefault method or any other way on react native for IOS?
const handleKeyPress = ({nativeEvent: {key: keyValue}}: any) => {
if (['Enter', 'Tab', ','].includes(keyValue)) {
//want to use preventDefault here
}
};
<TextInput
keyboardType="email-address"
mode="outlined"
placeholder={t('Enter e-mail or several, split by comma')}
value={email}
onChangeText={onEmailChange}
onKeyPress={handleKeyPress}
error={emailError}
autoCapitalize="none"
/>