From d76c57b79e75b1f69ef2e7b714597954a06d2e2d Mon Sep 17 00:00:00 2001 From: nightwing Date: Tue, 23 Jan 2018 20:34:44 +0400 Subject: [PATCH] workaround for broken test --- plugins/node_modules/ace/lib/ace/editor.js | 7 +++++++ plugins/node_modules/ace/lib/ace/selection.js | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/node_modules/ace/lib/ace/editor.js b/plugins/node_modules/ace/lib/ace/editor.js index 09bd1192..1ec567f0 100644 --- a/plugins/node_modules/ace/lib/ace/editor.js +++ b/plugins/node_modules/ace/lib/ace/editor.js @@ -640,6 +640,13 @@ Editor.$uid = 0; * Brings the current `textInput` into focus. **/ this.focus = function() { + // Safari needs the timeout + // iOS and Firefox need it called immediately + // to be on the save side we do both + var _self = this; + setTimeout(function() { + _self.textInput.focus(); + }); this.textInput.focus(); }; diff --git a/plugins/node_modules/ace/lib/ace/selection.js b/plugins/node_modules/ace/lib/ace/selection.js index 00adf55d..a5824f10 100644 --- a/plugins/node_modules/ace/lib/ace/selection.js +++ b/plugins/node_modules/ace/lib/ace/selection.js @@ -211,7 +211,7 @@ var Selection = function(session) { * Selects all the text in the document. **/ this.selectAll = function() { - this.anchor.setPosition(0, 0); + this.setSelectionAnchor(0, 0); this.cursor.setPosition(Number.MAX_VALUE, Number.MAX_VALUE); };