From a913291bb509acf991fbf6f9487740ac1301bd9e Mon Sep 17 00:00:00 2001 From: Mo Gorhom Date: Wed, 10 Feb 2021 10:18:54 +0100 Subject: [PATCH] Fix freezing ScrollView problem ## Description Fixes #1701 ## Changes - Reverted 95e76c593af3ce790582bb327953807c04771472 The fix introduced with 95e76c593af3ce790582bb327953807c04771472 is no longer valid as we override EventDispatcher. ### Before https://user-images.githubusercontent.com/4061838/107160873-38df4080-6999-11eb-8795-12990861c3e7.mp4 ### After https://user-images.githubusercontent.com/4061838/107160879-40064e80-6999-11eb-9d34-12d60d639691.mp4 ## Test code and steps to reproduce https://gist.github.com/gorhom/06e4c7f429ee1f6ab2d9a1c27dc9aa60 ## Checklist --- ios/native/NativeMethods.mm | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ios/native/NativeMethods.mm b/ios/native/NativeMethods.mm index 58f1e20652f..505dd43b340 100644 --- a/ios/native/NativeMethods.mm +++ b/ios/native/NativeMethods.mm @@ -37,14 +37,10 @@ } -NSString *eventDispatcherKey = @"eventDispatcher"; void scrollTo(int scrollViewTag, RCTUIManager *uiManager, double x, double y, bool animated) { UIView *view = [uiManager viewForReactTag:@(scrollViewTag)]; RCTScrollView *scrollView = (RCTScrollView *) view; - RCTEventDispatcher* oldEventDispatcher = [scrollView valueForKey:eventDispatcherKey]; - [scrollView setValue:nil forKey:eventDispatcherKey]; [scrollView scrollToOffset:(CGPoint){(CGFloat)x, (CGFloat)y} animated:animated]; - [scrollView setValue:oldEventDispatcher forKey:eventDispatcherKey]; } }