diff options
author | Samuel Newman <mozzius@protonmail.com> | 2025-09-05 18:39:55 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-05 08:39:55 -0700 |
commit | 73d72814c5c65f6302f9ab114b1f6414bc107eb0 (patch) | |
tree | 4769d15c19475fe309c0a5b55d2cdb9ba1935113 /patches | |
parent | daed047bb41bcdac374398b06f87895511ea34a8 (diff) | |
download | voidsky-73d72814c5c65f6302f9ab114b1f6414bc107eb0.tar.zst |
patch in unreleased upstream fix for jitter (#8952)
Diffstat (limited to 'patches')
-rw-r--r-- | patches/react-native-drawer-layout+4.1.10.patch | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/patches/react-native-drawer-layout+4.1.10.patch b/patches/react-native-drawer-layout+4.1.10.patch new file mode 100644 index 000000000..d4c0731f5 --- /dev/null +++ b/patches/react-native-drawer-layout+4.1.10.patch @@ -0,0 +1,38 @@ +diff --git a/node_modules/react-native-drawer-layout/lib/module/views/Drawer.native.js b/node_modules/react-native-drawer-layout/lib/module/views/Drawer.native.js +index efa71f9..a23c624 100644 +--- a/node_modules/react-native-drawer-layout/lib/module/views/Drawer.native.js ++++ b/node_modules/react-native-drawer-layout/lib/module/views/Drawer.native.js +@@ -124,15 +124,21 @@ export function Drawer({ + } + onTransitionEnd?.(!open); + }); ++ const animatingTo = useSharedValue(null) + const toggleDrawer = React.useCallback((open, velocity) => { + 'worklet'; + ++ if (animatingTo.value === (open ? 'open' : 'close')) { ++ return; ++ } ++ + const translateX = getDrawerTranslationX(open); + if (velocity === undefined) { + runOnJS(onAnimationStart)(open); + } + touchStartX.value = 0; + touchX.value = 0; ++ animatingTo.value = open ? 'open' : 'close'; + translationX.value = withSpring(translateX, { + velocity, + stiffness: 1000, +@@ -142,7 +148,10 @@ export function Drawer({ + restDisplacementThreshold: 0.01, + restSpeedThreshold: 0.01, + reduceMotion: ReduceMotion.Never +- }, finished => runOnJS(onAnimationEnd)(open, finished)); ++ }, finished => { ++ animatingTo.value = null; ++ runOnJS(onAnimationEnd)(open, finished) ++ }); + if (open) { + runOnJS(onOpen)(); + } else { |