Преглед на файлове

fix(WKWebView Scrolling): fixed broken scroll (#372)

fixes #371
Thibault Malbranche преди 5 години
родител
ревизия
2cef5cbb3f
No account linked to committer's email address
променени са 1 файла, в които са добавени 3 реда и са изтрити 8 реда
  1. 3
    8
      ios/RNCWKWebView.m

+ 3
- 8
ios/RNCWKWebView.m Целия файл

@@ -341,19 +341,14 @@ static NSURLCredential* clientAuthenticationCredential;
341 341
 {
342 342
   _scrollEnabled = scrollEnabled;
343 343
   _webView.scrollView.scrollEnabled = scrollEnabled;
344
-
345
-  // Override the scrollView delegate to prevent scrolling.
346
-  if (!scrollEnabled) {
347
-    _webView.scrollView.delegate = self;
348
-  } else {
349
-    _webView.scrollView.delegate = _webView;
350
-  }
351 344
 }
352 345
 
353 346
 - (void)scrollViewDidScroll:(UIScrollView *)scrollView
354 347
 {
355 348
   // Don't allow scrolling the scrollView.
356
-  scrollView.bounds = _webView.bounds;
349
+  if (!_scrollEnabled) {
350
+    scrollView.bounds = _webView.bounds;
351
+  }
357 352
 }
358 353
 
359 354
 - (void)setShowsHorizontalScrollIndicator:(BOOL)showsHorizontalScrollIndicator