From 2547f845eca97a1504635cfe39de7994d0a5de13 Mon Sep 17 00:00:00 2001 From: Luke Policinski Date: Tue, 3 Mar 2026 17:31:02 -0500 Subject: [PATCH 1/2] chore: disable auto focus in mobile --- components/chat/ChatLobby.vue | 34 +++++++++++++++++++-------------- components/chat/ChatMessage.vue | 7 ++++++- components/hub/ChatPanel.vue | 4 ++++ 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/components/chat/ChatLobby.vue b/components/chat/ChatLobby.vue index 0d5b2705..2c0c73cc 100644 --- a/components/chat/ChatLobby.vue +++ b/components/chat/ChatLobby.vue @@ -353,6 +353,10 @@ export default { type: Object as PropType, required: false, }, + disableAutoFocusOnActivate: { + type: Boolean, + default: false, + }, }, data() { return { @@ -604,23 +608,25 @@ export default { } // When activating a tab, always jump to the bottom so the latest - // messages are immediately visible. + // messages are immediately visible, and optionally focus the input. if (active && !this.isMinimized) { this.safeScrollToBottom(true); - this.$nextTick(() => { - const chatInput = this.$refs.chatInputRef as any; - if (chatInput) { - if (typeof chatInput.focus === "function") { - chatInput.focus(); - } else if (chatInput.$el) { - // Fallback: try to focus the first input inside the component root. - const el = chatInput.$el.querySelector( - "input, textarea, [tabindex]", - ) as HTMLElement | null; - el?.focus(); + if (!this.disableAutoFocusOnActivate) { + this.$nextTick(() => { + const chatInput = this.$refs.chatInputRef as any; + if (chatInput) { + if (typeof chatInput.focus === "function") { + chatInput.focus(); + } else if (chatInput.$el) { + // Fallback: try to focus the first input inside the component root. + const el = chatInput.$el.querySelector( + "input, textarea, [tabindex]", + ) as HTMLElement | null; + el?.focus(); + } } - } - }); + }); + } } }, }, diff --git a/components/chat/ChatMessage.vue b/components/chat/ChatMessage.vue index 6660bf0d..761b70c6 100644 --- a/components/chat/ChatMessage.vue +++ b/components/chat/ChatMessage.vue @@ -4,7 +4,12 @@ import PlayerDisplay from "~/components/PlayerDisplay.vue";