[PR #22922] [CLOSED] fix: dismiss mobile soft keyboard after sending message #65786

Closed
opened 2026-05-06 11:45:19 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/22922
Author: @Thump604
Created: 3/21/2026
Status: Closed

Base: mainHead: fix/mobile-keyboard-dismiss-on-send


📝 Commits (1)

  • 01accd4 fix: dismiss mobile soft keyboard after sending message

📊 Changes

2 files changed (+19 additions, -1 deletions)

View changed files

📝 src/lib/components/channel/MessageInput.svelte (+7 -1)
📝 src/lib/components/chat/MessageInput.svelte (+12 -0)

📄 Description

Summary

On iOS Safari (both browser and PWA), the soft keyboard remains visible after sending a message. Users must manually tap the chat area to dismiss it. This degrades the mobile experience — the keyboard covers half the screen and obscures the AI response.

Root Cause

After dispatching the submit event, no blur() is called on the textarea/contenteditable input. On desktop this is invisible (physical keyboard), but on mobile the soft keyboard stays open because the input retains focus.

Fix

Call document.activeElement?.blur() after submit, gated behind 'ontouchstart' in window so desktop behavior (keeping focus for rapid follow-up messages) is unchanged.

Applied to:

  • Chat MessageInput.svelte — all 3 submit paths: form submit, Enter key, speech auto-send
  • Channel MessageInput.svelte — replaced unconditional chatInputElement.focus() with mobile-aware blur/focus

Testing

  • iOS Safari (PWA): Send message → keyboard dismisses → response visible immediately
  • iOS Safari (browser): Same behavior
  • Desktop Chrome/Firefox/Safari: No change — input retains focus after send
  • Android Chrome: Keyboard dismisses after send (same improvement)
  • #16851 — Hiding keyboard in Web App mode in iOS
  • #20722 — Mobile viewport doesn't resize when keyboard appears
  • #18966 — Responsive iOS PWA suggestions (maintainer said "Open to reviewing PRs!")

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/22922 **Author:** [@Thump604](https://github.com/Thump604) **Created:** 3/21/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/mobile-keyboard-dismiss-on-send` --- ### 📝 Commits (1) - [`01accd4`](https://github.com/open-webui/open-webui/commit/01accd47bdfea9dea03b7b957e0d17bba9d2109e) fix: dismiss mobile soft keyboard after sending message ### 📊 Changes **2 files changed** (+19 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/components/channel/MessageInput.svelte` (+7 -1) 📝 `src/lib/components/chat/MessageInput.svelte` (+12 -0) </details> ### 📄 Description ## Summary On iOS Safari (both browser and PWA), the soft keyboard remains visible after sending a message. Users must manually tap the chat area to dismiss it. This degrades the mobile experience — the keyboard covers half the screen and obscures the AI response. ## Root Cause After dispatching the submit event, no `blur()` is called on the textarea/contenteditable input. On desktop this is invisible (physical keyboard), but on mobile the soft keyboard stays open because the input retains focus. ## Fix Call `document.activeElement?.blur()` after submit, gated behind `'ontouchstart' in window` so desktop behavior (keeping focus for rapid follow-up messages) is unchanged. Applied to: - **Chat `MessageInput.svelte`** — all 3 submit paths: form submit, Enter key, speech auto-send - **Channel `MessageInput.svelte`** — replaced unconditional `chatInputElement.focus()` with mobile-aware blur/focus ## Testing - **iOS Safari (PWA)**: Send message → keyboard dismisses → response visible immediately - **iOS Safari (browser)**: Same behavior - **Desktop Chrome/Firefox/Safari**: No change — input retains focus after send - **Android Chrome**: Keyboard dismisses after send (same improvement) ## Related Issues - #16851 — Hiding keyboard in Web App mode in iOS - #20722 — Mobile viewport doesn't resize when keyboard appears - #18966 — Responsive iOS PWA suggestions (maintainer said "Open to reviewing PRs!") --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-06 11:45:19 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#65786