From 091ad0f23dc08b8ca377af1028e9dd3d698a5571 Mon Sep 17 00:00:00 2001 From: Maurice Date: Mon, 23 Nov 2026 15:39:20 +0100 Subject: [PATCH] fix(collab): keep the keyboard open after sending a chat message The send button in the trip chat cancels its mousedown like the note format bar, so the native app no longer closes the keyboard after every message. --- client/src/components/Collab/CollabChat.test.tsx | 8 ++++++++ client/src/components/Collab/CollabChat.tsx | 2 +- client/src/mobile/screens/trip/tabs/MCollabChat.tsx | 1 + client/tests/unit/mobile/trip/MCollabChat.test.tsx | 7 +++++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/client/src/components/Collab/CollabChat.test.tsx b/client/src/components/Collab/CollabChat.test.tsx index 2b1230be5..ff341e9b3 100644 --- a/client/src/components/Collab/CollabChat.test.tsx +++ b/client/src/components/Collab/CollabChat.test.tsx @@ -288,6 +288,14 @@ describe('CollabChat', () => { expect(screen.getByText(/deleted/i)).toBeInTheDocument(); }); + it('FE-COMP-CHAT-038: the send button keeps the focus in the message field', async () => { + render(); + await screen.findByText('Start the conversation'); + fireEvent.change(screen.getByPlaceholderText('Type a message...'), { target: { value: 'One more' } }); + const sendButton = screen.getAllByRole('button').find(b => b.querySelector('.lucide-arrow-up')); + expect(sendButton && fireEvent.mouseDown(sendButton)).toBe(false); + }); + it('FE-COMP-CHAT-020: send button is disabled when input is empty', async () => { render(); await screen.findByText('Start the conversation'); diff --git a/client/src/components/Collab/CollabChat.tsx b/client/src/components/Collab/CollabChat.tsx index 3aa3342c6..2f8c090a1 100644 --- a/client/src/components/Collab/CollabChat.tsx +++ b/client/src/components/Collab/CollabChat.tsx @@ -85,7 +85,7 @@ export default function CollabChat({ tripId, currentUser }: CollabChatProps) { {/* Send */} {canEdit && ( -