Skip to content

Commit

Permalink
fix an issue where scrollview wouldn't unclip its cells
Browse files Browse the repository at this point in the history
Summary:
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 1fcd73f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions React/Views/RCTScrollView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down

0 comments on commit 1fcd73f

Please sign in to comment.