-
-
Notifications
You must be signed in to change notification settings - Fork 111
Open
Labels
KeyboardAwareScrollView 📜Anything related to KeyboardAwareScrollView componentAnything related to KeyboardAwareScrollView component🐛 bugSomething isn't workingSomething isn't working
Description
Describe the bug
When using KeyboardAwareScrollView from react-native-keyboard-controller, contentContainerStyle.gap is applied differently compared to a regular ScrollView.
- A gap is applied to the bottom of the content, even though this is not expected.
- Additionally, when gap: 0 is explicitly set, there is still 1px of bottom spacing rendered.
- This inconsistency does not occur with a normal ScrollView.
Code snippet
<KeyboardAwareScrollView
contentContainerStyle={{
backgroundColor: 'black',
gap: 10,
}}>
{array.map((_, index) => (
<View key={index} style={{ backgroundColor: 'red', height: 20 }} />
))}
</KeyboardAwareScrollView>
<KeyboardAwareScrollView
contentContainerStyle={{
backgroundColor: 'black',
gap: 0,
}}>
{array.map((_, index) => (
<View key={index} style={{ backgroundColor: 'red', height: 20 }} />
))}
</KeyboardAwareScrollView>
Repo for reproducing
To Reproduce
- Go to Expo snack
- See Layout
or
- Render a KeyboardAwareScrollView with contentContainerStyle.gap set.
- Compare it to a regular ScrollView with the same style.
- Observe the extra space at the bottom in KeyboardAwareScrollView.
Expected behavior
- The behavior of contentContainerStyle.gap should match that of ScrollView.
- No extra bottom spacing should be added when gap: 0 is specified.
Smartphone (please complete the following information):
- Desktop OS: Mac OS 15.4
- Device: iPhone 13 Pro, Galaxy Z Flip 4
- OS: iOS 18.3.2, Android 14
- RN version: 0.76.9
- RN architecture: old
- JS engine: Hermes
- Library version: 1.15.2
DenisDov
Metadata
Metadata
Assignees
Labels
KeyboardAwareScrollView 📜Anything related to KeyboardAwareScrollView componentAnything related to KeyboardAwareScrollView component🐛 bugSomething isn't workingSomething isn't working