From 2d02cf51c4f1e39e82a69248a5e4611674632c6d Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Wed, 11 Sep 2024 13:41:20 +0200 Subject: [PATCH] fix: close virtual keyboard on iOS Safari is message menu is opened --- .../src/lib/message/message.component.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/projects/stream-chat-angular/src/lib/message/message.component.ts b/projects/stream-chat-angular/src/lib/message/message.component.ts index e17a30ab..2c659d92 100644 --- a/projects/stream-chat-angular/src/lib/message/message.component.ts +++ b/projects/stream-chat-angular/src/lib/message/message.component.ts @@ -601,6 +601,14 @@ export class MessageComponent return; } else { this.shouldPreventMessageMenuClose = !options.fromTouch; + // Fix for iOS Safari: iOS Safari won't close the input if we open message menu + // The virtual keyboard can hide parts of the message menu, so we close the input here + if ( + document.activeElement && + typeof (document.activeElement as HTMLInputElement).blur !== + 'undefined' + ) + (document.activeElement as HTMLInputElement).blur(); this.messageMenuTrigger?.show(); } if (this.isViewInited) {