From 77329e9119945a5b60e46bff1320fcf12bc57a2f Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Fri, 13 Mar 2015 16:33:11 +0000 Subject: [PATCH] Deselect value if cancelling focus Amazingly, there is no deselect() as an opposite to select(). The nearest alternative seems to be setSelectionRange(0,0), but support is patchy. Most reliable solution is to set the value to itself. --- lib/ice-coder.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ice-coder.js b/lib/ice-coder.js index 32f90c1..b742585 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -1661,6 +1661,8 @@ var ICEcoder = { // Find & replace text according to user selections findReplace: function(findString,resultsOnly,buttonClick,isCancel) { if (isCancel){ + // Deselect by setting value to itself, then focus on editor + top.get('find').value = top.get('find').value; top.ICEcoder.focus(); return; }