From ef36b753daa76399270a2e74fcec8a49fa90c51b Mon Sep 17 00:00:00 2001 From: Rob Moen Date: Wed, 10 Jul 2013 10:22:20 -0700 Subject: [PATCH] Focus link inspector input prior to lookup. Since the menu only shows while it's input is focused, input must be focused prior to suggestions being popuplated. Fixes race condition where look up request is near instantaneous. Change-Id: Icf645d051415ac3ee9e15bc85f22f29dc9b64666 --- modules/ve/ui/inspectors/ve.ui.LinkInspector.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/ve/ui/inspectors/ve.ui.LinkInspector.js b/modules/ve/ui/inspectors/ve.ui.LinkInspector.js index 298ce70ea6..ef283869a2 100644 --- a/modules/ve/ui/inspectors/ve.ui.LinkInspector.js +++ b/modules/ve/ui/inspectors/ve.ui.LinkInspector.js @@ -129,10 +129,12 @@ ve.ui.LinkInspector.prototype.onOpen = function () { // Wait for animation to complete this.surface.disable(); setTimeout( ve.bind( function () { + // Note: Focus input prior to setting target annotation + this.targetInput.$input.focus(); // Setup annotation this.initialAnnotationHash = initialAnnotation && ve.getHash( initialAnnotation ); this.targetInput.setAnnotation( annotation ); - this.targetInput.$input.focus().select(); + this.targetInput.$input.select(); this.surface.enable(); }, this ), 200 ); };