From 78a4ed13ffc0f5d808e085a7a8e8f38f8f0eb5e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20K=C5=82os?= Date: Wed, 20 Dec 2023 19:22:38 +0100 Subject: [PATCH] calc: don't make app inactive on drag and drop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When Pivot table dialog was used and we drag and drop elements from list to other list in Firefox - then we sent userinactive message because we lost focus of a window. Don't do that. Signed-off-by: Szymon Kłos Change-Id: I03f1b8a72e4f318034569d4fffe496f32c5a8a51 --- browser/src/control/jsdialog/Widget.TreeView.js | 5 +++++ browser/src/map/Map.js | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/browser/src/control/jsdialog/Widget.TreeView.js b/browser/src/control/jsdialog/Widget.TreeView.js index b40828b7c..5351fa762 100644 --- a/browser/src/control/jsdialog/Widget.TreeView.js +++ b/browser/src/control/jsdialog/Widget.TreeView.js @@ -781,3 +781,8 @@ JSDialog.treeView = function (parentContainer, data, builder) { var buildInnerData = _treelistboxControl(parentContainer, data, builder); return buildInnerData; }; + +JSDialog.isDnDActive = function () { + var dndElements = document.querySelectorAll('.droptarget'); + return (dndElements && dndElements.length); +}; diff --git a/browser/src/map/Map.js b/browser/src/map/Map.js index 81fd60282..1cf017876 100644 --- a/browser/src/map/Map.js +++ b/browser/src/map/Map.js @@ -3,7 +3,7 @@ * L.Map is the central class of the API - it is used to create a map. */ -/* global app _ Cursor */ +/* global app _ Cursor JSDialog */ L.Map = L.Evented.extend({ @@ -1387,7 +1387,9 @@ L.Map = L.Evented.extend({ // Our browser tab lost focus. _onLostFocus: function () { - app.idleHandler._deactivate(); + // don't deactivate view while Drag and Drop in Pivot table dialog + if (!JSDialog.isDnDActive()) + app.idleHandler._deactivate(); }, // The editor got focus (probably a dialog closed or user clicked to edit).