Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix: respect reduced motion in programmatic scrolling #12871

Closedsaphid(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/12871/headopened View on GitHub

Showing 14 changed files with 42 additions and 21 deletions (loading 11).

x
0 of 14 viewed, 14 left
15 additions and 6 deletionsapps/mobile/src/features/threads/ThreadDetailScreen.tsxModified
View file
@@ -40,6 +40,7 @@
useState,
} from "react";
import {
+ AccessibilityInfo,
Alert,
AppState,
Keyboard,
@@ -737,14 +738,15 @@
// leaves the keyboard padding permanently applied — overshooting the
// anchor and leaving a phantom bottom inset once the reply streams in.
void KeyboardController.dismiss()
- .then(() => {
+ .then(() => AccessibilityInfo.isReduceMotionEnabled().catch(() => true))
+ .then((reducedMotion) => {
if (
selectedThreadKeyRef.current !== targetThreadKey ||
lastScrolledSubmittedMessageIdRef.current !== submittedMessageId
) {
return;
- return scrollMessageToEnd({ animated: true, closeKeyboard: false });
+ return scrollMessageToEnd({ animated: !reducedMotion, closeKeyboard: false });
.catch(() => {
if (
@@ -842,10 +844,17 @@
​