From 8b0cefbb51b667d825f38ed1b5a54aef70dc8e6a Mon Sep 17 00:00:00 2001 From: john hayes-reed Date: Tue, 14 Nov 2023 11:00:30 +0000 Subject: [PATCH] Focus on chat widget once loaded --- app/webpacker/controllers/chat_controller.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/webpacker/controllers/chat_controller.js b/app/webpacker/controllers/chat_controller.js index 527c863387..651773f181 100644 --- a/app/webpacker/controllers/chat_controller.js +++ b/app/webpacker/controllers/chat_controller.js @@ -47,6 +47,8 @@ export default class extends Controller { this.waitForZendeskScript(() => { this.showWebWidget(); this.waitForWebWidget(() => { + const chat = document.querySelector('[title="Messaging window"]'); + chat.focus(); this.chatTarget.textContent = 'Chat online'; }); });