From f1db972cc54a5c13a3ea1dfd19ae3d4e4a74cb55 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 22 Jul 2019 13:41:52 +0200 Subject: [PATCH] ui.js: Only set tabindex=-1 on elements which are otherwise not focusable --- public/js/icinga/ui.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/public/js/icinga/ui.js b/public/js/icinga/ui.js index 96b5e0914..6c90b46ac 100644 --- a/public/js/icinga/ui.js +++ b/public/js/icinga/ui.js @@ -172,7 +172,7 @@ } if ($element.length) { - if (typeof $element.attr('tabindex') === 'undefined') { + if (! this.isFocusable($element)) { $element.attr('tabindex', -1); } @@ -185,6 +185,12 @@ } }, + isFocusable: function ($element) { + return $element.is('*[tabindex], a[href], input:not([disabled]), button:not([disabled])' + + ', select:not([disabled]), textarea:not([disabled]), iframe, area[href], object' + + ', embed, *[contenteditable]'); + }, + moveToLeft: function () { var col2 = this.cutContainer($('#col2')); var kill = this.cutContainer($('#col1'));