Skip to content

Commit 4e8c2a1

Browse files
committed
fix(mobile): remount only the native editor so a running context import survives
1 parent 70adceb commit 4e8c2a1

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
@@ -34,6 +34,8 @@ import {
3434

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

4446
export function ComposerEditor({
4547
draftKey,
48+
hidden,
4649
environmentId,
4750
onOpenMention,
4851
onOpenAttachment,
@@ -156,6 +159,7 @@ export function ComposerEditor({
156159
return (
157160
<>
158161
<NativeComposerEditor
162+
key={hidden ? "hidden" : "visible"}
159163
{...props}
160164
enterBehavior={props.enterBehavior ?? preferredEnterBehavior}
161165
onChangeText={changeText}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
790790
layout={COMPOSER_LAYOUT_TRANSITION}
791791
>
792792
<ComposerEditor
793-
key={props.hidden ? "hidden" : "visible"}
793+
hidden={props.hidden}
794794
draftKey={composerDraftKey}
795795
environmentId={props.environmentId}
796796
onOpenMention={(path) => {

0 commit comments

Comments
 (0)