mirror of
https://github.com/status-im/react-native.git
synced 2025-02-04 21:53:30 +00:00
Fix TouchNativeFeedback so that the ripple starts from where a person touches
Summary: It needs the touch coordinates for with-in the element, not for on the page. Closes https://github.com/facebook/react-native/pull/5400 Reviewed By: svcscm Differential Revision: D2848834 Pulled By: androidtrunkagent fb-gh-sync-id: 88cf0fd7bd2332eb3db835b26438064412c8358c
This commit is contained in:
parent
f3e2c29220
commit
48117ce6c4
@ -623,7 +623,9 @@ var TouchableMixin = {
|
||||
var touch = TouchEventUtils.extractSingleTouch(e.nativeEvent);
|
||||
var pageX = touch && touch.pageX;
|
||||
var pageY = touch && touch.pageY;
|
||||
this.pressInLocation = {pageX: pageX, pageY: pageY};
|
||||
var locationX = touch && touch.locationX;
|
||||
var locationY = touch && touch.locationY;
|
||||
this.pressInLocation = {pageX, pageY, locationX, locationY};
|
||||
},
|
||||
|
||||
_getDistanceBetweenPoints: function (aX, aY, bX, bY) {
|
||||
|
@ -141,7 +141,7 @@ var TouchableNativeFeedback = React.createClass({
|
||||
touchableHandleActivePressIn: function() {
|
||||
this.props.onPressIn && this.props.onPressIn();
|
||||
this._dispatchPressedStateChange(true);
|
||||
this._dispatchHotspotUpdate(this.pressInLocation.pageX, this.pressInLocation.pageY);
|
||||
this._dispatchHotspotUpdate(this.pressInLocation.locationX, this.pressInLocation.locationY);
|
||||
},
|
||||
|
||||
touchableHandleActivePressOut: function() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user