From 1fcd73f3841d5afbabfa3adecfb7d4036d91a60e Mon Sep 17 00:00:00 2001 From: Martin Kralik Date: Wed, 15 Jun 2016 07:59:17 -0700 Subject: [PATCH] fix an issue where scrollview wouldn't unclip its cells 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 --- React/Views/RCTScrollView.m | 1 + 1 file changed, 1 insertion(+) diff --git a/React/Views/RCTScrollView.m b/React/Views/RCTScrollView.m index cee26c1802c503..e65e900f2eb255 100644 --- a/React/Views/RCTScrollView.m +++ b/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));