Skip to content

Commit

Permalink
Merge pull request #3816 from Expensify/Rory-RevertSuppressTouch
Browse files Browse the repository at this point in the history
Revert suppression of touchstart to fix regressions

(cherry picked from commit af376d2)
  • Loading branch information
roryabraham authored and OSBotify committed Jun 30, 2021
1 parent b79d047 commit 6c49589
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/components/PressableWithSecondaryInteraction/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,17 @@ class PressableWithSecondaryInteraction extends Component {
super(props);

this.executeSecondaryInteractionOnContextMenu = this.executeSecondaryInteractionOnContextMenu.bind(this);
this.preventDefault = this.preventDefault.bind(this);
}

componentDidMount() {
if (this.props.forwardedRef && _.isFunction(this.props.forwardedRef)) {
this.props.forwardedRef(this.pressableRef);
}
this.pressableRef.addEventListener('contextmenu', this.executeSecondaryInteractionOnContextMenu);
this.pressableRef.addEventListener('touchstart', this.preventDefault);
}

componentWillUnmount() {
this.pressableRef.removeEventListener('contextmenu', this.executeSecondaryInteractionOnContextMenu);
this.pressableRef.removeEventListener('touchstart', this.preventDefault);
}

/**
* @param {touchstart} e - TouchEvent.
* https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent
*/
preventDefault(e) {
e.preventDefault();
}

/**
Expand Down

0 comments on commit 6c49589

Please sign in to comment.