Skip to content

Commit 7af91f8

Browse files
committed
fix: rename "mouseLeave" to "mouseOut"
The "mouseLeave" event in browsers does not bubble, while "mouseOut" does.
1 parent 85aa69a commit 7af91f8

7 files changed

Lines changed: 9 additions & 9 deletions

File tree

Libraries/Components/Touchable/TouchableOpacity.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ var TouchableOpacity = createReactClass({
260260
onResponderRelease={this.touchableHandleResponderRelease}
261261
onResponderTerminate={this.touchableHandleResponderTerminate}
262262
onMouseOver={this.props.onMouseOver}
263-
onMouseLeave={this.props.onMouseLeave}
263+
onMouseOut={this.props.onMouseOut}
264264
onContextMenuItemClick={this.props.onContextMenuItemClick}
265265
contextMenu={this.props.contextMenu}>
266266
{this.props.children}

Libraries/Components/Touchable/TouchableWithoutFeedback.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const TouchableWithoutFeedback = createReactClass({
111111
*/
112112
hitSlop: EdgeInsetsPropType,
113113
onMouseOver: PropTypes.func,
114-
onMouseLeave: PropTypes.func,
114+
onMouseOut: PropTypes.func,
115115
onContextMenuItemClick: PropTypes.func,
116116
contextMenu: PropTypes.array,
117117
},
@@ -214,7 +214,7 @@ const TouchableWithoutFeedback = createReactClass({
214214
onResponderRelease: this.touchableHandleResponderRelease,
215215
onResponderTerminate: this.touchableHandleResponderTerminate,
216216
onMouseOver: this.props.onMouseOver,
217-
onMouseLeave: this.props.onMouseLeave,
217+
onMouseOut: this.props.onMouseOut,
218218
onContextMenuItemClick: this.props.onContextMenuItemClick,
219219
contextMenu: this.props.contextMenu,
220220
style,

Libraries/Components/Touchable/__tests__/__snapshots__/TouchableHighlight-test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ exports[`TouchableHighlight renders correctly 1`] = `
1212
nativeID={undefined}
1313
onLayout={undefined}
1414
onMouseOver={undefined}
15-
onMouseLeave={undefined}
15+
onMouseOut={undefined}
1616
onResponderGrant={[Function]}
1717
onResponderMove={[Function]}
1818
onResponderRelease={[Function]}

Libraries/Components/View/ReactNativeViewAttributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ReactNativeViewAttributes.UIView = {
3131
shouldRasterizeIOS: true,
3232
onLayout: true,
3333
onMouseOver: true,
34-
onMouseLeave: true,
34+
onMouseOut: true,
3535
onAccessibilityTap: true,
3636
onMagicTap: true,
3737
collapsable: true,

Libraries/Components/View/ViewPropTypes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ module.exports = {
434434
* @platform macos
435435
*/
436436
onMouseOver: PropTypes.func,
437-
onMouseLeave: PropTypes.func,
437+
onMouseOut: PropTypes.func,
438438
onDragEnter: PropTypes.func,
439439
onDragLeave: PropTypes.func,
440440
onDrop: PropTypes.func,

React/Base/RCTTouchHandler.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ @implementation RCTTouchHandler
4747
CFTimeInterval _mostRecentEnqueueJS;
4848

4949
/*
50-
* Storing tag to dispatch mouseOver and mouseLeave events
50+
* Storing tag to dispatch mouseOver and mouseOut events
5151
*/
5252
NSNumber *_currentMouseOverTag;
5353
}
@@ -336,7 +336,7 @@ - (void)mouseMoved:(NSEvent *)event
336336
}
337337
if (_currentMouseOverTag != reactTag && _currentMouseOverTag.intValue > 0) {
338338
[_bridge enqueueJSCall:@"RCTEventEmitter.receiveEvent"
339-
args:@[_currentMouseOverTag, @"topMouseLeave"]];
339+
args:@[_currentMouseOverTag, @"topMouseOut"]];
340340
[_bridge enqueueJSCall:@"RCTEventEmitter.receiveEvent"
341341
args:@[reactTag, @"topMouseOver"]];
342342
_currentMouseOverTag = reactTag;

React/Views/RCTViewManager.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ - (RCTShadowView *)shadowView
7474

7575
// Mouse events
7676
@"mouseOver",
77-
@"mouseLeave",
77+
@"mouseOut",
7878
];
7979
}
8080

0 commit comments

Comments
 (0)