Skip to content

Commit 9d2ec8f

Browse files
committed
sendMouseEvent --> emitMouseEvent
1 parent 9b2d400 commit 9d2ec8f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,7 +1669,7 @@ - (void)keyUp:(NSEvent *)event {
16691669

16701670
#pragma mark - Mouse Events
16711671

1672-
- (void)sendMouseEvent:(BOOL)isMouseOver {
1672+
- (void)emitMouseEvent {
16731673
if (!_eventEmitter) {
16741674
return;
16751675
}
@@ -1690,7 +1690,7 @@ - (void)sendMouseEvent:(BOOL)isMouseOver {
16901690
.metaKey = static_cast<bool>(modifierFlags & NSEventModifierFlagCommand),
16911691
};
16921692

1693-
if (isMouseOver) {
1693+
if (_hasMouseOver) {
16941694
_eventEmitter->onMouseEnter(mouseEvent);
16951695
} else {
16961696
_eventEmitter->onMouseLeave(mouseEvent);
@@ -1709,7 +1709,7 @@ - (void)updateMouseOverIfNeeded
17091709
NSPoint locationInView = [self convertPoint:locationInWindow fromView:nil];
17101710
BOOL insideBounds = NSPointInRect(locationInView, self.visibleRect);
17111711

1712-
// On macOS 14.0 visibleRect can be larger than the view bounds
1712+
// On macOS 14+ visibleRect can be larger than the view bounds
17131713
insideBounds &= NSPointInRect(locationInView, self.bounds);
17141714

17151715
if (hasMouseOver && !insideBounds) {
@@ -1722,7 +1722,7 @@ - (void)updateMouseOverIfNeeded
17221722

17231723
if (hasMouseOver != _hasMouseOver) {
17241724
_hasMouseOver = hasMouseOver;
1725-
[self sendMouseEvent:hasMouseOver];
1725+
[self emitMouseEvent];
17261726
}
17271727
}
17281728

@@ -1795,7 +1795,7 @@ - (void)mouseEntered:(NSEvent *)event
17951795
}
17961796

17971797
_hasMouseOver = YES;
1798-
[self sendMouseEvent:_hasMouseOver];
1798+
[self emitMouseEvent];
17991799
}
18001800

18011801
- (void)mouseExited:(NSEvent *)event
@@ -1805,7 +1805,7 @@ - (void)mouseExited:(NSEvent *)event
18051805
}
18061806

18071807
_hasMouseOver = NO;
1808-
[self sendMouseEvent:_hasMouseOver];
1808+
[self emitMouseEvent];
18091809
}
18101810
#endif // macOS]
18111811

0 commit comments

Comments
 (0)