diff --git a/.changeset/fix-mobile-edit-keyboard.md b/.changeset/fix-mobile-edit-keyboard.md new file mode 100644 index 000000000..54e6d20f6 --- /dev/null +++ b/.changeset/fix-mobile-edit-keyboard.md @@ -0,0 +1,5 @@ +--- +default: patch +--- + +Fix editing messages on mobile where tapping the edit field flickered the keyboard shut. diff --git a/src/app/components/editor/Editor.tsx b/src/app/components/editor/Editor.tsx index 0a61c2cad..01ba1075a 100644 --- a/src/app/components/editor/Editor.tsx +++ b/src/app/components/editor/Editor.tsx @@ -440,9 +440,12 @@ export const CustomEditor = forwardRef( onPaste={onPaste} // Defer to OS capitalization setting (respects iOS sentence-case toggle). autoCapitalize="sentences" - // keeps focus after pressing send. - onBlur={() => { - if (mobileOrTablet()) ReactEditor.focus(editor); + // keeps focus after pressing send, but yields to another editor. + onBlur={(evt) => { + if (!mobileOrTablet()) return; + const next = evt.relatedTarget as HTMLElement | null; + if (next && next !== editableRef.current && next.isContentEditable) return; + ReactEditor.focus(editor); }} style={{ boxShadow: 'none' }} />