From f67efc90f15c5435d12636ad349b3989b6b71485 Mon Sep 17 00:00:00 2001 From: Tom Najdek Date: Wed, 29 Nov 2023 13:48:02 +0100 Subject: [PATCH] Fix: Tags now have a proper drop target size --- .../content/zotero/containers/tagSelectorContainer.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/chrome/content/zotero/containers/tagSelectorContainer.jsx b/chrome/content/zotero/containers/tagSelectorContainer.jsx index 1a443dd974..296f366dc5 100644 --- a/chrome/content/zotero/containers/tagSelectorContainer.jsx +++ b/chrome/content/zotero/containers/tagSelectorContainer.jsx @@ -589,10 +589,10 @@ Zotero.TagSelector = class TagSelectorContainer extends React.PureComponent { return; } - var elem = event.target; + let elem = event.target.closest('.tag-selector-item'); // Ignore drops not on tags - if (!elem.classList.contains('tag-selector-item')) { + if (elem === null) { return; } @@ -603,13 +603,13 @@ Zotero.TagSelector = class TagSelectorContainer extends React.PureComponent { event.dataTransfer.dropEffect = remove ? "move" : "copy"; }, onDragExit: function (event) { - event.target.classList.remove('dragged-over'); + event.target.closest('.tag-selector-item')?.classList?.remove?.('dragged-over'); }, onDrop: async function(event) { - var elem = event.target; + let elem = event.target.closest('.tag-selector-item'); // Ignore drops not on tags - if (!elem.classList.contains('tag-selector-item')) { + if (elem === null) { return; }