File tree Expand file tree Collapse file tree
src/components/KeyboardAwareScrollView Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -150,13 +150,19 @@ const KeyboardAwareScrollView = forwardRef<
150150 useSharedValue < FocusedInputSelectionChangedEvent | null > ( null ) ;
151151 const ghostViewSpace = useSharedValue ( - 1 ) ;
152152 const pendingSelectionForFocus = useSharedValue ( false ) ;
153+ const scrollViewPageY = useSharedValue ( 0 ) ;
153154
154155 const { height } = useWindowDimensions ( ) ;
155156
156157 const onScrollViewLayout = useCallback (
157158 ( e : LayoutChangeEvent ) => {
158159 scrollViewTarget . value = findNodeHandle ( scrollViewAnimatedRef . current ) ;
159160
161+ // @ts -expect-error something is wrong with the type of `measureInWindow`
162+ scrollViewRef . current ?. measureInWindow ( ( _x , y ) => {
163+ scrollViewPageY . value = y ;
164+ } ) ;
165+
160166 onLayout ?.( e ) ;
161167 } ,
162168 [ onLayout ] ,
@@ -205,7 +211,7 @@ const KeyboardAwareScrollView = forwardRef<
205211 return interpolatedScrollTo ;
206212 }
207213
208- if ( point < 0 ) {
214+ if ( point < scrollViewPageY . value ) {
209215 const positionOnScreen = visibleRect - bottomOffset ;
210216 const topOfScreen = scrollPosition . value + point ;
211217
You can’t perform that action at this time.
0 commit comments