Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): composer buttons stay visible with animations removed #19239

MergedPipyakas(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/19239/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/voice-input/ComposerDictationControl.tsxModified
View file
@@ -13,6 +13,7 @@
LinearTransition,
ReduceMotion,
useAnimatedStyle,
+ useReducedMotion,
useSharedValue,
withTiming,
type EntryExitAnimationFunction,
@@ -135,14 +136,19 @@
readonly showsDictation: boolean;
readonly visible?: boolean;
}) {
+ // Android can drop the reduced-motion flip's final frame, leaving the toolbar invisible.
+ const reducedMotion = useReducedMotion();
+ const entering = props.showsDictation ? DICTATION_TOOLBAR_ENTERING : DRAFT_TOOLBAR_ENTERING;
+ const exiting = props.showsDictation ? DICTATION_TOOLBAR_EXITING : DRAFT_TOOLBAR_EXITING;
+​
return (
<View className="relative h-[44px] overflow-hidden">
{props.visible !== false ? (
<Animated.View
key={props.showsDictation ? "dictation" : "draft"}
className="absolute inset-0"
- entering={props.showsDictation ? DICTATION_TOOLBAR_ENTERING : DRAFT_TOOLBAR_ENTERING}
- exiting={props.showsDictation ? DICTATION_TOOLBAR_EXITING : DRAFT_TOOLBAR_EXITING}
+ entering={reducedMotion ? undefined : entering}
+ exiting={reducedMotion ? undefined : exiting}
style={{ backfaceVisibility: "hidden" }}