Skip to content

Commit 07a67fb

Browse files
committed
fix(mobile): remount only the native editor so a running context import survives
1 parent 71ba087 commit 07a67fb

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎apps/mobile/src/components/ComposerEditor.tsx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ import {
3333

3434
export type ComposerEditorProps = NativeComposerEditorProps & {
3535
readonly draftKey?: string | null;
36+
/** iOS destroys a hidden native editor, so it remounts; the import lifecycle here survives. */
37+
readonly hidden?: boolean;
3638
readonly environmentId?: EnvironmentId;
3739
readonly onOpenMention?: (path: string) => void;
3840
readonly onOpenAttachment?: (attachment: ComposerDocumentAttachment) => void;
@@ -42,6 +44,7 @@ export type ComposerEditorProps = NativeComposerEditorProps & {
4244

4345
export function ComposerEditor({
4446
draftKey,
47+
hidden,
4548
environmentId,
4649
onOpenMention,
4750
onOpenAttachment,
@@ -160,6 +163,7 @@ export function ComposerEditor({
160163
return (
161164
<>
162165
<NativeComposerEditor
166+
key={hidden ? "hidden" : "visible"}
163167
{...props}
164168
enterBehavior={props.enterBehavior ?? preferredEnterBehavior}
165169
onChangeText={changeText}

‎apps/mobile/src/features/threads/ThreadComposer.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ export const ThreadComposer = memo(function ThreadComposer(props: ThreadComposer
855855
layout={COMPOSER_LAYOUT_TRANSITION}
856856
>
857857
<ComposerEditor
858-
key={props.hidden ? "hidden" : "visible"}
858+
hidden={props.hidden}
859859
draftKey={composerDraftKey}
860860
environmentId={props.environmentId}
861861
onOpenMention={(path) => {

0 commit comments

Comments
 (0)