Skip to content

Commit

Permalink
Fix touches and scroll in vscode. Refs #1847
Browse files Browse the repository at this point in the history
  • Loading branch information
yury committed Sep 6, 2023
1 parent 8b88526 commit 572da56
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
29 changes: 0 additions & 29 deletions Blink/TermView.m
Original file line number Diff line number Diff line change
Expand Up @@ -221,35 +221,6 @@ - (void)addBrowserWebView:(NSURL *)url agent: (NSString *)agent injectUIO: (BOOL
_browserView.UIDelegate = self;
_browserView.navigationDelegate = self;

if (injectUIO) {

_browserView.scrollView.delaysContentTouches = NO;
_browserView.scrollView.canCancelContentTouches = NO;
[_browserView.scrollView setScrollEnabled:NO];
[_browserView.scrollView.panGestureRecognizer setEnabled:NO];
// _gestureInteraction = [[WKWebViewGesturesInteraction alloc] initWithJsScrollerPath:@"t.scrollPort_.scroller_"];
// [_webView addInteraction:_gestureInteraction];

UIPanGestureRecognizer *rec = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(_pan:)];
rec.maximumNumberOfTouches = 1;
rec.cancelsTouchesInView = YES;
rec.allowedScrollTypesMask = UIScrollTypeMaskAll;
rec.allowedTouchTypes = @[@(UITouchTypeIndirectPointer)];
rec.delegate = self;


UITapGestureRecognizer *rec2 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(_pan2:)];
// rec2.maximumNumberOfTouches = 1;
rec2.cancelsTouchesInView = YES;
// rec.allowedScrollTypesMask = UIScrollTypeMaskAll;
rec2.allowedTouchTypes = @[@(UITouchTypeIndirectPointer)];
rec2.delegate = self;

[_browserView addGestureRecognizer:rec];
[_browserView addGestureRecognizer:rec2];

}

[self addSubview:_browserView];
[_browserView setOpaque:NO];
_browserView.backgroundColor = [UIColor clearColor];
Expand Down
Loading

0 comments on commit 572da56

Please sign in to comment.