diff options
author | Brian Hall <brian@hack.design> | 2017-01-31 07:12:31 +0300 |
---|---|---|
committer | Brian Hall <brian@hack.design> | 2017-01-31 21:28:49 +0300 |
commit | 7bf6df8463c4f8871682f385e9368d169b4ffecf (patch) | |
tree | 5848818ea63a6f69b19b5d4b5b49433b6229d137 /app/assets/javascripts/lib | |
parent | b78d06b78143b16dccc5d5afaa8796473b68bea1 (diff) |
Change the reply shortcut to focus the field even without a selection.
Diffstat (limited to 'app/assets/javascripts/lib')
-rw-r--r-- | app/assets/javascripts/lib/utils/common_utils.js.es6 | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/assets/javascripts/lib/utils/common_utils.js.es6 b/app/assets/javascripts/lib/utils/common_utils.js.es6 index 51993bb3420..e3bff2559fd 100644 --- a/app/assets/javascripts/lib/utils/common_utils.js.es6 +++ b/app/assets/javascripts/lib/utils/common_utils.js.es6 @@ -162,6 +162,7 @@ w.gl.utils.getSelectedFragment = () => { const selection = window.getSelection(); + if (selection.rangeCount === 0) return null; const documentFragment = selection.getRangeAt(0).cloneContents(); if (documentFragment.textContent.length === 0) return null; |