Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix report screen scrollbar on Android is on the left screen #29253

Merged
merged 4 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions patches/react-native+0.72.4+003+VerticalScrollBarPosition.patch

This file was deleted.

1 change: 1 addition & 0 deletions src/components/InvertedFlatList/BaseInvertedFlatList.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ function BaseInvertedFlatList(props) {
// Web requires that items be measured or else crazy things happen when scrolling.
getItemLayout={shouldMeasureItems ? getItemLayout : undefined}
windowSize={15}
inverted
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ function CellRendererComponent(props) {
{...props}
style={[
props.style,

/**
* To achieve absolute positioning and handle overflows for list items,
* it is necessary to assign zIndex values. In the case of inverted lists,
Expand Down

This file was deleted.

71 changes: 0 additions & 71 deletions src/components/InvertedFlatList/index.android.js

This file was deleted.

1 change: 0 additions & 1 deletion src/components/InvertedFlatList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ function InvertedFlatList(props) {
<BaseInvertedFlatList
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
inverted
ref={listRef}
shouldMeasureItems
contentContainerStyle={StyleSheet.compose(contentContainerStyle, styles.justifyContentEnd)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ export default forwardRef((props, ref) => (
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
ref={ref}
inverted
CellRendererComponent={CellRendererComponent}
/**
* To achieve absolute positioning and handle overflows for list items, the property must be disabled
* for Android native builds.
* Source: https://reactnative.dev/docs/0.71/optimizing-flatlist-configuration#removeclippedsubviews
*/
removeClippedSubviews={false}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we merging both ios and android files?
this removeClippedSubviews={false} seems to be specific to android currently.

@bernhardoj

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removeClippedSubviews is true by default only on Android and false on iOS. So, it's okay to merge it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bernhardoj Could you share any information on this? I couldn't find the same in docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the docs saying the default value is false
https://reactnative.dev/docs/next/optimizing-flatlist-configuration#removeclippedsubviews

and here is the docs saying specifically the Android default value is true
https://reactnative.dev/docs/next/flatlist#removeclippedsubviews

/>
));
5 changes: 0 additions & 5 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -2964,11 +2964,6 @@ const styles = (theme) => ({
horizontal: windowWidth - 140,
}),

invert: {
// It's important to invert the Y AND X axis to prevent a react native issue that can lead to ANRs on android 13
transform: [{scaleX: -1}, {scaleY: -1}],
},

iPhoneXSafeArea: {
backgroundColor: theme.inverse,
flex: 1,
Expand Down
Loading