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

[BUG] paddingBottom styling property is forced to zero on Android #568

Open alexisdelage opened 1 year ago

alexisdelage commented 1 year ago

Description

On the FormScrollView component, when passing custom styles to the prop contentContainerStyle as an array, the property paddingBottom is override to 0 on Android.

Exemple

 <KeyboardAwareScrollView
      enableOnAndroid
      contentContainerStyle={[
        { flexGrow: 1 },
        { paddingBottom: 75 },
      ]}
    />

Result: The paddingBottom is applied on iOS but not on Android.

Possible cause

The paddingBottom property is override at this line in the code: https://github.com/APSL/react-native-keyboard-aware-scroll-view/blob/9eee405f7b3e261faf86a0fc8e495288d91c853e/lib/KeyboardAwareHOC.js#L531 It checks if a paddingBottom property is present on the contentContainerStyle object before setting it zero, but it does not handle the case where contentContainerStyle is an array (which can be the case according to the type of StyleProp<ViewStyle> of React Native

VictorPulzz commented 1 year ago

Same for me

VictorPulzz commented 1 year ago

@slorber My be you check this?

slorber commented 1 year ago

I am not maintaining this library and haven't used RN recently