Skip to content

Commit dc96e0e

Browse files
authored
Refactor how focusable is handled in RCTView (#1437)
* Update RCTView.m * Refactor * Don't need to override `canBecomeKeyView` * Update RCTView.m * Update RCTView.m
1 parent cb5eaa9 commit dc96e0e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

React/Views/RCTView.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1440,9 +1440,14 @@ - (void)mouseUp:(NSEvent *)event
14401440
}
14411441
}
14421442

1443+
- (BOOL)needsPanelToBecomeKey {
1444+
// We need to override this so that mouse clicks don't move keyboard focus on focusable views by default.
1445+
return false;
1446+
}
1447+
14431448
- (BOOL)acceptsFirstResponder
14441449
{
1445-
return ([self focusable] && [NSApp isFullKeyboardAccessEnabled]) || [super acceptsFirstResponder];
1450+
return [self focusable] || [super acceptsFirstResponder];
14461451
}
14471452

14481453
- (void)updateTrackingAreas

0 commit comments

Comments
 (0)