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).