Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/facebook/react-native.git. Pull mirroring updated .
  1. May 05, 2021
  2. Apr 30, 2021
  3. Apr 09, 2020
  4. Apr 08, 2020
  5. Apr 07, 2020
  6. Apr 04, 2020
  7. Apr 03, 2020
  8. Mar 31, 2020
  9. Mar 27, 2020
  10. Mar 18, 2020
    • Tim Yung's avatar
      Pressability: Fix Missing `onLongPress` Gestures · 1f8b6980
      Tim Yung authored
      Summary:
      The current implementation of `Pressability` has a bug related to `onLongPress`.
      
      When a user starts a press gesture, we keep track of the activation position (occurs after waiting `delayPressIn` milliseconds). If the touch moves away from that position by more than 10dp, we rule out the long press gesture. This means no matter how long you hold down the press, even if you move it back to within 10dp, we will not fire `onLongPress`.
      
      However, there is currently a bug where we never reset the cached activation position. This means that after the first press gesture, all subsequent long press gestures must start within 10dp of that first press gesture. This leads to seemingly intermittent missing long press gestures.
      
      This fixes the bug by ensuring that whenever a press gestures is terminated (either via a cancel or release), we reset the activation position.
      
      Changelog:
      [General][Fixed] - Fixed Pressability to properly fire `onLongPress`.
      
      Reviewed By: TheSavior
      
      Differential Revision: D20410075
      
      fbshipit-source-id: e4727b7a9585ce3ea39481fc13e56b6b91740c8c
      1f8b6980
  11. Mar 12, 2020
  12. Mar 07, 2020
  13. Mar 05, 2020