Skip to content
TypeScript

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

Quy Ngoc Nguyen651fe94dc945
diff --git a/apps/mobile/src/features/voice-input/ComposerDictationControl.tsx b/apps/mobile/src/features/voice-input/ComposerDictationControl.tsx
index 6e7977e928a..3e7d852be75 100644
--- a/apps/mobile/src/features/voice-input/ComposerDictationControl.tsx
+++ b/apps/mobile/src/features/voice-input/ComposerDictationControl.tsx
@@ -13,6 +13,7 @@ import Animated, {
LinearTransition,
ReduceMotion,
useAnimatedStyle,
+ useReducedMotion,
useSharedValue,
withTiming,
type EntryExitAnimationFunction,
@@ -135,14 +136,19 @@ export function ComposerDictationToolbar(props: {
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" }}
>
{props.children}