Skip to content

Commit

Permalink
Fix freezing ScrollView problem
Browse files Browse the repository at this point in the history
## Description

Fixes #1701 

## Changes

- Reverted 95e76c5
The fix introduced with 95e76c5 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
  • Loading branch information
gorhom authored Feb 10, 2021
1 parent 0cee963 commit a913291
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions ios/native/NativeMethods.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

}

0 comments on commit a913291

Please sign in to comment.