From 01ced67ab39a3055cced66e58c9fcf857f4db920 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 8 Aug 2016 13:57:05 -0400 Subject: [PATCH] FIX: Focus on usernames if it's blank when composing a message --- app/assets/javascripts/discourse/controllers/composer.js.es6 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/controllers/composer.js.es6 b/app/assets/javascripts/discourse/controllers/composer.js.es6 index b89d61a98b1..c04063ed1b0 100644 --- a/app/assets/javascripts/discourse/controllers/composer.js.es6 +++ b/app/assets/javascripts/discourse/controllers/composer.js.es6 @@ -69,7 +69,9 @@ export default Ember.Controller.extend({ focusTarget(replyingToTopic, creatingPM, usernames) { if (this.capabilities.isIOS) { return "none"; } - if (creatingPM && usernames === this.currentUser.get('username')) { + // Focus on usernames if it's blank or if it's just you + usernames = usernames || ""; + if (creatingPM && usernames.length === 0 || usernames === this.currentUser.get('username')) { return 'usernames'; }