APSL / react-native-keyboard-aware-scroll-view

A ScrollView component that handles keyboard appearance and automatically scrolls to focused TextInput.
MIT License
5.24k stars 643 forks source link

In Android Scroll Not working When add it inside View #549

Open Salmankhan033 opened 1 year ago

Salmankhan033 commented 1 year ago

When I place it inside a View then Scroll is not working in android but it's good on IOS. Below is my code


 return (
    <View style={styles.container}>
      <Header
        title="Create your budget"
        iconLeft={SVGS.BackArrow}
        leftIconPress={() => props.navigation.goBack()}
      />
      <KeyboardAwareScrollView>

          <CreateBudgetHeader pageNo={1} icon={SVGS.BudgetOne} />
          <View>
            <Text style={styles.text}>Enter Budget Name</Text>
            <CustomTextInput
              placeholder={'Name'}
              onFocus={() => setNameFocus(true)}
              isFocus={nameFocus}
              onBlur={() => submitName()}
              errorText={nameErrorText}
              onChangeText={text => setName(text)}
              style={styles.inPutContainer}
              inputStyle={styles.input}
              errorTextStyle={styles.errorText}
              value={name}
            />
          </View>
          <View style={styles.btnView}>
            {name == '' ? (
              <CustomButton
                title={'Continue'}
                onPress={() => onPressContinue()}
                containerStyle={{backgroundColor: Colors.gray}}
                disabled={true}
              />
            ) : (
              <CustomButton
                title={'Continue'}
                onPress={() => onPressContinue()}
              />
            )}
          </View>

      </KeyboardAwareScrollView>
    </View>
  );
};
jtvargas commented 1 year ago

Any updates on this issue?

david-gettins commented 3 months ago

The description of this issue is a little ambiguous so excuse me if this is not relevant...

I have experienced, what I believe is, a similar issue. When any other component is a sibling of the KeyboardAwareScrollView, it does not show on Android. In my case the sibling is a PortalHost from the @gorhom/react-native-portal library.

If anyone else ends up here with the issue I have described, my work around was to set the KeyboardAwareScrollView style.position to absolute.