Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,6 @@ - (void)mouseDown:(NSEvent *)event
return;
}


_isTouchInsideBounds = YES;
[self handleAnimatePressIn];
[super mouseDown:event];
Expand All @@ -1208,7 +1207,7 @@ - (void)mouseUp:(NSEvent *)event
if (!_userEnabled) {
return;
}

NSPoint locationInView = [self convertPoint:[event locationInWindow] fromView:nil];
_isHovered = NSPointInRect(locationInView, self.bounds);
[self recordHoverSampleForMouseEvent:event];
Expand All @@ -1224,7 +1223,7 @@ - (void)mouseDragged:(NSEvent *)event
if (!_userEnabled) {
return;
}

NSPoint locationInWindow = [event locationInWindow];
NSPoint locationInView = [self convertPoint:locationInWindow fromView:nil];
BOOL currentlyInside = NSPointInRect(locationInView, self.bounds);
Expand Down Expand Up @@ -1260,7 +1259,7 @@ - (BOOL)beginTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event
if (!_userEnabled) {
return NO;
}

_isTouchInsideBounds = YES;
// A pencil's hover-out arrives just before touch-down but only schedules the
// clear, so `_isHovered` still reflects the open hover. Under Reduce Motion
Expand Down Expand Up @@ -1426,7 +1425,8 @@ - (BOOL)shouldHandleTouch:(RNGHUIView *)view atPoint:(CGPoint)point
{
if ([view isKindOfClass:[RNGestureHandlerButton class]]) {
RNGestureHandlerButton *button = (RNGestureHandlerButton *)view;
return button.userEnabled;
return button.userEnabled && button.pointerEvents != RNGestureHandlerPointerEventsBoxNone &&
button.pointerEvents != RNGestureHandlerPointerEventsNone;
}

// Certain subviews such as RCTViewComponentView have been observed to have disabled
Expand Down Expand Up @@ -1473,7 +1473,9 @@ - (RNGHUIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
if (!subview.isHidden && subview.alpha > 0) {
CGPoint convertedPoint = [subview convertPoint:point fromView:self];
UIView *hitView = [subview hitTest:convertedPoint withEvent:event];
if (hitView != nil && [self shouldHandleTouch:hitView atPoint:point]) {
if (hitView != nil &&
([hitView isKindOfClass:[RNGestureHandlerButton class]] ||
[self shouldHandleTouch:hitView atPoint:point])) {
return hitView;
}
}
Expand Down
Loading