Skip to content

Commit 2117256

Browse files
authored
Send mouse up notifications for all enabled NSControls (#263)
* remove a stale event from the native tracking queue that prevents every other click from registering * comment change inline
1 parent 2296bda commit 2117256

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

React/Base/RCTTouchHandler.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,10 @@ - (void)_recordNewTouches:(NSSet *)touches
128128
#else // [TODO(macOS ISS#2323203)
129129
CGPoint touchLocation = [self.view convertPoint:touch.locationInWindow fromView:nil];
130130
NSView *targetView = [self.view hitTest:touchLocation];
131-
if ([targetView isKindOfClass:NSText.class]) {
131+
// Pair the mouse down events with mouse up events so our _nativeTouches cache doesn't get stale
132+
if ([targetView isKindOfClass:[NSControl class]]) {
133+
_shouldSendMouseUpOnSystemBehalf = [(NSControl*)targetView isEnabled];
134+
} else if ([targetView isKindOfClass:[NSText class]]) {
132135
_shouldSendMouseUpOnSystemBehalf = [(NSText*)targetView isSelectable];
133136
} else {
134137
_shouldSendMouseUpOnSystemBehalf = NO;

0 commit comments

Comments
 (0)