Skip to content
Browse files

fix an issue where scrollview wouldn't unclip its cells

Issue we were seeing: scrollview would clip its cells when it was resized to 0 height and moved offscreen, but it wouldn't add it back when it was resized and moved back
Why this was happening: scrollview wouldn't rerun its un/clipping logic after the first run unless 1/it has 0x0 frame or 2/it has been scrolled. Neither was happening here.
Fix: run the un/clipping logic when scrollview's frame has been changed since the last clipping.

Reviewed By: javache

Differential Revision: D3436996

fbshipit-source-id: 1a8cfeb72b425fcc80815d30743fa308b9c75ab6
  • Loading branch information
majak authored and Facebook Github Bot 3 committed Jun 15, 2016
1 parent 979d1c7 commit 1fcd73f3841d5afbabfa3adecfb7d4036d91a60e
Showing with 1 addition and 0 deletions.
  1. +1 −0 React/Views/RCTScrollView.m
@@ -515,6 +515,7 @@ - (void)updateClippedSubviews

const BOOL shouldClipAgain =
CGRectIsNull(_lastClippedToRect) ||
!CGRectEqualToRect(_lastClippedToRect, bounds) ||
(scrollsHorizontally && (bounds.size.width < leeway || fabs(_lastClippedToRect.origin.x - bounds.origin.x) >= leeway)) ||
(scrollsVertically && (bounds.size.height < leeway || fabs(_lastClippedToRect.origin.y - bounds.origin.y) >= leeway));

0 comments on commit 1fcd73f

Please sign in to comment.
You can’t perform that action at this time.