You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importReact,{forwardRef}from"react";import{ScrollView,ScrollViewProps,View,}from"react-native";exporttypeKeyboardAwareScrollViewProps={/** The distance between keyboard and focused `TextInput` when keyboard is shown. Default is `0`. */bottomOffset?: number;/** Prevents automatic scrolling of the `ScrollView` when the keyboard gets hidden, maintaining the current screen position. Default is `false`. */disableScrollOnKeyboardHide?: boolean;/** Controls whether this `KeyboardAwareScrollView` instance should take effect. Default is `true` */enabled?: boolean;/** Adjusting the bottom spacing of KeyboardAwareScrollView. Default is `0` */extraKeyboardSpace?: number;/** Custom component for `ScrollView`. Default is `ScrollView` */ScrollViewComponent?: React.ComponentType<ScrollViewProps>;}&ScrollViewProps;constKeyboardAwareScrollView=forwardRef<ScrollView,React.PropsWithChildren<KeyboardAwareScrollViewProps>>(({
children,
...rest},ref,)=>{return(<><ScrollView{...rest}scrollEventThrottle={16}>{children}<Viewstyle={{height: 336,backgroundColor: 'red'}}/></ScrollView></>);},);exportdefaultKeyboardAwareScrollView;
I don't have any logs, bug from what I debugged in XCode methods like `scrollToOffset`/`scrollToEnd`/`scrollViewShouldScrollToTop` are not getting called.
Description
I use this component:
And I use it the code:
Steps to reproduce
ScrollViewsuddenly scrolls to topExpected result is that
ScrollViewshould remain its position.React Native Version
0.76.2
Affected Platforms
Runtime - iOS
Output of
npx react-native infoStacktrace or Logs
Reproducer
https://github.com/kirillzyusko/react-native-keyboard-controller/blob/main/example/src/screens/Examples/AwareScrollView/index.tsx
Screenshots and Videos
ScreenRecording_12-30-2024.12-25-01.PM_1.MP4