From 57360754b426d04fd895d5d88bbb6fdb5b2036fa Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Sun, 20 Dec 2015 20:00:00 -0600 Subject: [PATCH] Replace setTimeout with requestAnimationFrame --- notebook/static/notebook/js/commandpalette.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notebook/static/notebook/js/commandpalette.js b/notebook/static/notebook/js/commandpalette.js index baa7e203a..d85bfc71b 100644 --- a/notebook/static/notebook/js/commandpalette.js +++ b/notebook/static/notebook/js/commandpalette.js @@ -122,9 +122,9 @@ define(function(require){ */ var onResult = function(node, query, result, resultCount) { if (resultCount == 1) { - setTimeout(function() { + window.requestAnimationFrame(function() { $('.typeahead-list > li:nth-child(2)').addClass('active'); - }, 0); + }); } };