From 7c2201da8b06b87f82433482ece25b3dfc8f4190 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 5 May 2019 15:02:30 +0200 Subject: [PATCH] fix massinput click handling --- static/js/utils/massInput.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/static/js/utils/massInput.js b/static/js/utils/massInput.js index 1b5cf10ac..85e7049cb 100644 --- a/static/js/utils/massInput.js +++ b/static/js/utils/massInput.js @@ -82,9 +82,16 @@ } return function(event) { + var activeElement; + // check if event occured from either a mass input add/delete button or // from inside one of massinput's inputs (i.e. they are focused/active) - var activeElement = element.querySelector(':focus, :active'); + if (event.type === 'click') { + activeElement = event.target; + } else { + activeElement = element.querySelector(':focus, :active'); + } + if (!activeElement) { return false; }