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.
This commit is contained in:
Matt Pass
2015-03-13 16:33:11 +00:00
parent 7faf1099b0
commit 77329e9119

View File

@@ -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;
}