Skip to content

Commit

Permalink
removed manual inverted list workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Oct 11, 2023
1 parent ac8000f commit e00986d
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 166 deletions.
22 changes: 0 additions & 22 deletions patches/react-native+0.72.4+003+VerticalScrollBarPosition.patch

This file was deleted.

This file was deleted.

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

This file was deleted.

13 changes: 0 additions & 13 deletions src/components/InvertedFlatList/index.ios.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
import React from 'react';
import React, {forwardRef} from 'react';
import {View} from 'react-native';
import PropTypes from 'prop-types';

const propTypes = {
/** Position index of the list item in a list view */
index: PropTypes.number.isRequired,

/** Styles that are passed to the component */
style: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.object]),
};

const defaultProps = {
style: {},
};
import BaseInvertedFlatList from './BaseInvertedFlatList';

function CellRendererComponent(props) {
return (
Expand All @@ -21,7 +9,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 All @@ -35,8 +22,17 @@ function CellRendererComponent(props) {
);
}

CellRendererComponent.propTypes = propTypes;
CellRendererComponent.defaultProps = defaultProps;
CellRendererComponent.displayName = 'CellRendererComponent';

export default CellRendererComponent;
export default forwardRef((props, ref) => (
<BaseInvertedFlatList
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
ref={ref}
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}
/>
));
5 changes: 0 additions & 5 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -2960,11 +2960,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}],
},

keyboardShortcutModalContainer: {
maxHeight: '100%',
flex: 0,
Expand Down

0 comments on commit e00986d

Please sign in to comment.