@@ -32,7 +32,7 @@ import {
3232import { StackActions , useFocusEffect , useNavigation } from "@react-navigation/native" ;
3333import type { ReactNode } from "react" ;
3434import { useEffect , useEffectEvent , useRef , useState , type RefObject } from "react" ;
35- import { Keyboard , Platform , View , type ViewStyle } from "react-native" ;
35+ import { I18nManager , Keyboard , Platform , View , type ViewStyle } from "react-native" ;
3636import { composerImageGallery } from "../../lib/composerImageGallery" ;
3737import { filePreviewGallery } from "../../lib/filePreviewGallery" ;
3838import { FilePreviewModal , type FilePreviewSource } from "../../components/FilePreviewModal" ;
@@ -97,6 +97,7 @@ import {
9797 resolveComposerSendPresentation ,
9898 type ComposerSendPresentation ,
9999} from "./composerSendPresentation" ;
100+ import { compactEditorInsets } from "./compactEditorInsets" ;
100101import { ComposerCommandPopover } from "./ComposerCommandPopover" ;
101102import { ComposerPopoverAnchor } from "./ComposerPopoverAnchor" ;
102103import { ComposerQueuedEditAttachments } from "./ComposerQueuedEdit" ;
@@ -157,12 +158,19 @@ function useCompactComposerEditor(text: ScaledTextRole, value: string) {
157158 ( contentHeight > text . lineHeight * 1.5 ||
158159 ( compactWidth > 0 && contentSize . width > compactWidth ) ) ;
159160 const compactRowHeight = Math . max ( 44 , minimum ) ;
161+ const isRTL = I18nManager . isRTL ;
160162 const editorStyle = useAnimatedStyle ( ( ) => ( {
161163 position : "absolute" ,
162164 overflow : "hidden" ,
163165 height,
164- left : isExpanded ? 14 : editorX . value + 4 ,
165- right : isExpanded ? 14 : rowWidth . value - editorX . value - editorWidth . value + 4 ,
166+ ...( isExpanded
167+ ? { left : 14 , right : 14 }
168+ : compactEditorInsets ( {
169+ slotX : editorX . value ,
170+ slotWidth : editorWidth . value ,
171+ rowWidth : rowWidth . value ,
172+ isRTL,
173+ } ) ) ,
166174 // The full-width editor must move above the controls in the same frame it widens.
167175 bottom : isExpanded ? 52 : ( compactRowHeight - minimum ) / 2 ,
168176 } ) ) ;
0 commit comments