From 9c0c0cbd3eddd2edd2ac455863baea2db08ab26d Mon Sep 17 00:00:00 2001 From: Skylar Sadlier Date: Wed, 4 Aug 2021 10:30:14 -0600 Subject: [PATCH] Update dataTables.keyTable.js If the user if focused on an element that isn't the body then button events should be ignored. I had users that had their tab events intercepted instead of tabbing to the next input. If the user has an input, button, etc focused the keys should be ignored. --- js/dataTables.keyTable.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/dataTables.keyTable.js b/js/dataTables.keyTable.js index 099e0ac..4fe3661 100644 --- a/js/dataTables.keyTable.js +++ b/js/dataTables.keyTable.js @@ -830,6 +830,10 @@ $.extend( KeyTable.prototype, { if ( (e.keyCode === 0 || e.ctrlKey || e.metaKey || e.altKey) && !(e.ctrlKey && e.altKey) ) { return; } + + if(document.activeElement && document.activeElement.tagName.toLowerCase() !== 'body') { + return; + } // If not focused, then there is no key action to take var lastFocus = this.s.lastFocus;