-
-
Notifications
You must be signed in to change notification settings - Fork 126
Labels
KeyboardAwareScrollView 📜Anything related to KeyboardAwareScrollView componentAnything related to KeyboardAwareScrollView component🐛 bugSomething isn't workingSomething isn't working📚 componentsAnything related to the exported components of this libraryAnything related to the exported components of this library
Description
Describe the bug
onScroll
on KeyboardAwareScrollView
is not fired
Code snippet
Just add onScroll={console.log}
in example app.
Repo for reproducing
You can use example app.
To Reproduce
Steps to reproduce the behavior:
- Go to
KeyboardAwareScrollView
- Scroll view
- See console output
Expected behavior
You should see events if you scroll ScrollView
.
Smartphone (please complete the following information):
- Desktop OS: MacOS 14.2.1
- Device: iPhone 15 Pro
- OS: iOS 15.2
- RN version: 0.72.4
- RN architecture: old
- JS engine: Hermes
- Library version: 1.10.2
Additional context
It can be fixed by adding next code into onScroll
handler:
const onScroll = useAnimatedScrollHandler(
{
onScroll: (e) => {
position.value = e.contentOffset.y;
+ if (onScrollProp) {
+ runOnJS(onScrollProp)({ nativeEvent: e });
+ }
},
},
[],
);
or assign our onScroll
handler as onScrollReanimated
(REA intercept all events for a given view, so there is no difference which prop to use).
Metadata
Metadata
Assignees
Labels
KeyboardAwareScrollView 📜Anything related to KeyboardAwareScrollView componentAnything related to KeyboardAwareScrollView component🐛 bugSomething isn't workingSomething isn't working📚 componentsAnything related to the exported components of this libraryAnything related to the exported components of this library