From 8cf766d177508d4b4e75a6780b0041c3f6d9f0f4 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Mon, 1 Oct 2012 16:32:02 -0500 Subject: [PATCH] Prevents key handling when the input/toolbar controls are focused --- web/viewer.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web/viewer.js b/web/viewer.js index 2662adff7..e9de32196 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -2358,12 +2358,14 @@ window.addEventListener('keydown', function keydown(evt) { // Some shortcuts should not get handled if a control/input element // is selected. var curElement = document.activeElement; - if (curElement && curElement.tagName == 'INPUT') + if (curElement && (curElement.tagName == 'INPUT' || + curElement.tagName == 'SELECT')) { return; - var controlsElement = document.getElementById('controls'); + } + var controlsElement = document.getElementById('toolbar'); while (curElement) { if (curElement === controlsElement && !PDFView.isFullscreen) - return; // ignoring if the 'controls' element is focused + return; // ignoring if the 'toolbar' element is focused curElement = curElement.parentNode; }