diff --git a/static/js/hashchange.js b/static/js/hashchange.js index 488925bd50..ea68c1135f 100644 --- a/static/js/hashchange.js +++ b/static/js/hashchange.js @@ -248,6 +248,7 @@ exports.initialize = function () { exports.exit_settings = function (callback) { if (should_ignore(window.location.hash)) { + ui.blur_active_element(); ignore.flag = true; window.location.hash = ignore.prev || "#"; if (typeof callback === "function") { diff --git a/static/js/ui.js b/static/js/ui.js index 205d63ea1b..a470479d5c 100644 --- a/static/js/ui.js +++ b/static/js/ui.js @@ -35,6 +35,11 @@ exports.focus_on = function (field_id) { $("#" + field_id).focus(); }; +exports.blur_active_element = function () { + // this blurs anything that may perhaps be actively focused on. + document.activeElement.blur(); +}; + function amount_to_paginate() { // Some day we might have separate versions of this function // for Page Up vs. Page Down, but for now it's the same