react-native-macos/React
Janic Duplessis 671b975d92 Fix a bug with ListView with sticky headers + RefreshControl
Summary:The bug is caused by a weird race condition. What happens is that when calling `UIRefreshControl#endRefreshing` the `UIScrollView` delegate `scrollViewDidScroll` function is called synchronously and then `dockClosestSectionHeader` crashes because the sticky header indexes are updated but not the contentView children.

I fixed it by adding an updating property on `RCTRefreshControl` and setting it before calling `endRefreshing` so we can know not to call `dockClosestSectionHeader` at that moment.

Tested with both `RefreshControl` and `onRefreshStart` prop.

I reproduced the bug by replacing ListViewExample.js in UIExplorer with https://gist.github.com/janicduplessis/05fc58e852f3e80e51b9

Fixes #5440

cc nicklockwood
Closes https://github.com/facebook/react-native/pull/5445

Differential Revision: D2953984

Pulled By: nicklockwood

fb-gh-sync-id: c17a6a75ab31ef54d478706ed17a8115a11d734e
shipit-source-id: c17a6a75ab31ef54d478706ed17a8115a11d734e
2016-02-19 05:55:36 -08:00
..
Base Enable persistent socket between packager and bridge (1/N). 2016-02-16 23:05:36 -08:00
Executors Expose way for native modules to modify JSC context 2016-02-15 12:58:29 -08:00
Layout updated css-layout and fixed callsites 2015-12-21 10:18:41 -08:00
Modules Fix OSS iOS build 2016-02-17 07:38:33 -08:00
Profiler Added throttling on requests made by RCTImageLoader 2016-02-16 12:42:34 -08:00
React.xcodeproj Fix OSS iOS build 2016-02-17 07:38:33 -08:00
Views Fix a bug with ListView with sticky headers + RefreshControl 2016-02-19 05:55:36 -08:00