Skip to content

fix(composer): let Enter insert a newline on mobile - #64

Merged
kahme247 merged 1 commit into
ompweb-dev:mainfrom
andrebrait:fix/mobile-enter-newline
Sep 10, 2026
Merged

kahme247 merged 1 commit into
ompweb-dev:mainfrom
andrebrait:fix/mobile-enter-newline

Conversation

@andrebrait

Copy link
Copy Markdown
Collaborator

What

On phones there is no practical Shift+Enter, so Enter on the soft keyboard sent the message and there was no way to insert a line break. On the mobile breakpoint (useIsMobile, ≤ 640 px) Enter now inserts a newline; the Send / Queue / Stop button in the composer footer submits. Desktop is unchanged (Enter sends, Shift+Enter inserts a newline).

The slash / @ / history menu Enter handlers and the dictation stop shortcut run before this branch and keep working on mobile.

Verification

  • npx tsc --noEmit, npm run lint, node --test components/ChatInput.test.mjs.
  • Dev server with a 390 px viewport: typing line one, Enter, line two leaves line one\nline two in the textarea and sends nothing. At 1200 px: Shift+Enter inserts a newline, Enter sends and clears the input.

Soft keyboards have no Shift+Enter, so on the mobile breakpoint Enter
inserted nothing and sent the message instead. Enter now inserts a
newline there; the Send button submits. Desktop behavior is unchanged.
@kahme247
kahme247 merged commit 318271f into ompweb-dev:main Sep 10, 2026
@andrebrait
andrebrait deleted the fix/mobile-enter-newline branch September 14, 2026 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants