Created
July 19, 2020 16:19
-
-
Save jehartzog/c9b2f35994c756f80332474841386d9c to your computer and use it in GitHub Desktop.
Patch Pressable to remove initial delay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/node_modules/react-native/Libraries/Pressability/Pressability.js b/node_modules/react-native/Libraries/Pressability/Pressability.js | |
index 37555d5..82190ed 100644 | |
--- a/node_modules/react-native/Libraries/Pressability/Pressability.js | |
+++ b/node_modules/react-native/Libraries/Pressability/Pressability.js | |
@@ -277,14 +277,14 @@ const isTerminalSignal = signal => | |
signal === 'RESPONDER_TERMINATED' || signal === 'RESPONDER_RELEASE'; | |
const DEFAULT_LONG_PRESS_DELAY_MS = 370; // 500 - 130 | |
-const DEFAULT_PRESS_DELAY_MS = 130; | |
+const DEFAULT_PRESS_DELAY_MS = 0; | |
const DEFAULT_PRESS_RECT_OFFSETS = { | |
bottom: 30, | |
left: 20, | |
right: 20, | |
top: 20, | |
}; | |
-const DEFAULT_MIN_PRESS_DURATION = 130; | |
+const DEFAULT_MIN_PRESS_DURATION = 0; | |
/** | |
* Pressability implements press handling capabilities. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why was DEFAULT_PRESS_DELAY_MS set to 0?
Now ripple effect is always being triggered when scrolling a selectable listview of items.