Skip to content

Commit

Permalink
Comments styling. Explain why the removeClippedSubviews is switched off
Browse files Browse the repository at this point in the history
  • Loading branch information
petromoldovan committed Jul 10, 2023
1 parent 45914bb commit 143567b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ function CellRendererComponent(props) {
{...props}
style={[
styles.invert,
// To achieve absolute positioning and handle overflows for list items,
// it is necessary to assign zIndex values. In the case of inverted lists,
// the lower list items will have higher zIndex values compared to the upper
// list items. Consequently, lower list items can overflow the upper list items.
// See: https://github.com/Expensify/App/issues/20451

/**
* To achieve absolute positioning and handle overflows for list items,
* it is necessary to assign zIndex values. In the case of inverted lists,
* the lower list items will have higher zIndex values compared to the upper
* list items. Consequently, lower list items can overflow the upper list items.
* See: https://github.com/Expensify/App/issues/20451
*/
{ zIndex: -props.index }
]}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ 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,
// the lower list items will have higher zIndex values compared to the upper
// list items. Consequently, lower list items can overflow the upper list items.
// See: https://github.com/Expensify/App/issues/20451

/**
* To achieve absolute positioning and handle overflows for list items,
* it is necessary to assign zIndex values. In the case of inverted lists,
* the lower list items will have higher zIndex values compared to the upper
* list items. Consequently, lower list items can overflow the upper list items.
* See: https://github.com/Expensify/App/issues/20451
*/
{ zIndex: -props.index }
]}
/>
Expand Down
7 changes: 6 additions & 1 deletion src/components/InvertedFlatList/index.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ class InvertedFlatList extends React.Component {
ListFooterComponentStyle={[styles.invert, this.props.ListFooterComponentStyle]}
verticalScrollbarPosition="left" // We are mirroring the X and Y axis, so we need to swap the scrollbar position
CellRendererComponent={CellRendererComponent}
// Enables absolute positioning with zIndex in the list. Source: https://reactnative.dev/docs/0.71/optimizing-flatlist-configuration#removeclippedsubviews

/**
* 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}
/>
);
Expand Down

0 comments on commit 143567b

Please sign in to comment.