Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6213

Need to click twice in KeyboardAvoidingView even when keyboardshouldpersisttaps is always

$
0
0

I am using a KeyboardAvoidingView to move a button up with the keyboard, within that I have a scrollview which keybordShouldPersistTaps is set to always, within the scrollview, I am using a Formik form. I still have to double click a button twice in order to get the keyboard to dismiss and submit my data. I have always tried to manually dismiss/handle the keyboard on the scrollview with no luck, Any other approaches I should try?

<KeyboardAvoidingView style={{ flex: 1 }} behavior={'padding'}><ScrollView contentContainerStyle={{ flexGrow: 1 }} keyboardShouldPersistTaps={'always'}><Formik            initialValues={this.state}            validationSchema={this.schema}            onSubmit={(values, actions) => {                            actions.setSubmitting(false);            }}            render={({ handleBlur, handleChange, handleSubmit, values, isValid }) => {              return (<View style={onboardingStyles.inputContainer}><View><Text theme={theme} style={onboardingStyles.headerText}>                      {i18n.t('phone_verify')}</Text><TextInput                      activeHighlight                      value={RizeCore.util.formatPhoneDOM(values.phone)}                      onChangeText={(val: string) => {                        const phone = RizeCore.util.parseOutDigits(val, 10);                        return handleChange('phone')(phone);                      }}                      onBlur={() => handleBlur('phone')}                      label={i18n.t('phone_number')}                      style={onboardingStyles.input}                      labelStyle={{ color: 'white' }}                      keyboardType={Platform.OS === 'web' ? 'default' : 'number-pad'}                      returnKeyType="done"                    /></View><BottomFixedCTA                    ctaLabel={i18n.t('phone_send_code')}                    loading={smsCodeIsBusy}                    disabled={!isValid}                    onPress={handleSubmit as undefined}                    onBackPress={this._navSignUp}                  /></View>              );            }}          /></ScrollView></KeyboardAvoidingView>

Viewing all articles
Browse latest Browse all 6213

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>