Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): scroll to end jumps instead of glides when Reduce Motion is on #16015

Mergedsaphid(GitHub profile, opens in a new tab)merged 9 commits intomain fromrefs/pull/16015/headmerged by juliusmarminge View on GitHub

Showing 1 changed file with 8 additions and 2 deletions.

x
0 of 1 viewed, 1 left
8 additions and 2 deletionsapps/mobile/src/features/threads/ThreadDetailScreen.tsxModified
View file
@@ -81,6 +81,7 @@
useAnimatedReaction,
useAnimatedStyle,
useDerivedValue,
+ useReducedMotion,
useSharedValue,
withTiming,
} from "react-native-reanimated";
@@ -726,6 +727,7 @@
[userInputCoverageApplies],
const { freeze, scrollMessageToEnd } = useKeyboardScrollToEnd({ listRef });
+ const reduceMotion = useReducedMotion();
// Repin timers fire after the render that scheduled them, so they read follow
// state from the ref the writers below keep in step with it.
const endFollowEnabledRef = useRef(true);
@@ -895,7 +897,10 @@
) {
return;
- return scrollMessageToEnd({ animated: true, closeKeyboard: false });
+ return scrollMessageToEnd({
+ animated: !reduceMotion,
+ closeKeyboard: false,
+ });
.catch(() => {
if (