Skip to content

Commit 7733575

Browse files
authored
useScrollTo - Fix Android RTL issue with post rn73 (#3644)
* refactor: comment out unused RTL scrolling logic in useScrollTo hook * refactor: remove unused import from useScrollTo hook * Added comment
1 parent f38bdbe commit 7733575

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/hooks/useScrollTo/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import _ from 'lodash';
22
import {RefObject, useCallback, useRef} from 'react';
33
import {ScrollView, FlatList, LayoutChangeEvent} from 'react-native';
4-
import {Constants} from '../../commons/new';
54

65
export type ScrollToSupportedViews = ScrollView | FlatList;
76

@@ -62,7 +61,8 @@ const useScrollTo = <T extends ScrollToSupportedViews>(props: ScrollToProps<T>):
6261
[horizontal]);
6362

6463
const scrollTo = useCallback((offset: number, animated = true) => {
65-
if (
64+
// Fix that was for Android RTL. Scrolling is now aligned between IOS and Android and offset is ok.
65+
/* if (
6666
horizontal &&
6767
Constants.isRTL &&
6868
Constants.isAndroid &&
@@ -71,7 +71,7 @@ const useScrollTo = <T extends ScrollToSupportedViews>(props: ScrollToProps<T>):
7171
) {
7272
const scrollingWidth = Math.max(0, contentSize.current - containerSize.current);
7373
offset = scrollingWidth - offset;
74-
}
74+
} */
7575

7676
// @ts-ignore
7777
if (_.isFunction(scrollViewRef.current?.scrollToOffset)) {

0 commit comments

Comments
 (0)