Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -2534,3 +2534,25 @@ describe('opt out mechanism - Unstable_uncullableView & Unstable_uncullableTrace
);
});
});

describe('culling inside ScrollView with overflow visible', () => {
it('shows view outside of bounds', () => {
const root = Fantom.createRoot({viewportWidth: 100, viewportHeight: 100});

Fantom.runTask(() => {
root.render(
<ScrollView style={{height: 100, width: 100, overflow: 'visible'}}>
<View
nativeID={'child'}
style={{height: 10, width: 10, marginTop: 145}} // 145 is below the viewport
/>
</ScrollView>,
);
});

// Child is not culled because overflow:visible.
expect(root.takeMountingManagerLogs()).toContain(
'Create {type: "View", nativeID: "child"}',
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,17 @@ CullingContext CullingContext::adjustCullingContextIfNeeded(
if (ReactNativeFeatureFlags::enableViewCulling()) {
if (auto scrollViewShadowNode =
dynamic_cast<const ScrollViewShadowNode*>(pair.shadowNode)) {
cullingContext.frame.origin =
-scrollViewShadowNode->getContentOriginOffset(
/* includeTransform */ true);
cullingContext.frame.size =
scrollViewShadowNode->getLayoutMetrics().frame.size;
cullingContext.transform = Transform::Identity();
if (scrollViewShadowNode->getConcreteProps().yogaStyle.overflow() !=
yoga::Overflow::Visible) {
cullingContext.frame.origin =
-scrollViewShadowNode->getContentOriginOffset(
/* includeTransform */ true);
cullingContext.frame.size =
scrollViewShadowNode->getLayoutMetrics().frame.size;
cullingContext.transform = Transform::Identity();
} else {
cullingContext = {};
}
} else if (pair.shadowView.traits.check(
ShadowNodeTraits::Trait::RootNodeKind)) {
cullingContext = {};
Expand Down
Loading