From 5487e48ca2d01bb608c34ac029815bab108dc12e Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Tue, 28 Apr 2020 19:46:10 -0400 Subject: [PATCH] chat: autofocus input on desktop --- pkg/interface/chat/src/js/components/lib/chat-input.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/interface/chat/src/js/components/lib/chat-input.js b/pkg/interface/chat/src/js/components/lib/chat-input.js index 6a61b57f1..f30e5016d 100644 --- a/pkg/interface/chat/src/js/components/lib/chat-input.js +++ b/pkg/interface/chat/src/js/components/lib/chat-input.js @@ -340,8 +340,13 @@ export class ChatInput extends Component { { - this.editor = editor; -}} + this.editor = editor; + if (!/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test( + navigator.userAgent + )) { + editor.focus(); + } + }} onChange={(e, d, v) => this.messageChange(e, d, v)} />