From f66fbf592c68c061703f7485ae2f0985a3766e11 Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Fri, 26 Sep 2014 17:50:18 +0200 Subject: [PATCH] Fix error msg in focus-me for non-textarea inputs --- src/js/controller/write.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/controller/write.js b/src/js/controller/write.js index 3b0f532..41d0c12 100644 --- a/src/js/controller/write.js +++ b/src/js/controller/write.js @@ -459,7 +459,8 @@ define(function(require) { $timeout(function() { var el = element[0]; el.focus(); - if (typeof el.selectionStart !== 'undefined' && typeof el.selectionEnd !== 'undefined') { + // set cursor to start of textarea + if (el.type === 'textarea') { el.selectionStart = 0; el.selectionEnd = 0; }