From ce6fa235cb00390b2eb3e67039ece6b5a5ed0901 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 16 Nov 2016 10:49:28 +0000 Subject: [PATCH] js/loader: do not steal focus placed by module --- public/js/icinga/loader.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/js/icinga/loader.js b/public/js/icinga/loader.js index 73df66c79..cfa1cee4b 100644 --- a/public/js/icinga/loader.js +++ b/public/js/icinga/loader.js @@ -827,7 +827,10 @@ if (typeof $container.attr('tabindex') === 'undefined') { $container.attr('tabindex', -1); } - $container.focus(); + // Do not touch focus in case a module or component already placed it + if ($(document.activeElement).closest('.container').attr('id') !== containerId) { + $container.focus(); + } }, 0); } } else {