Fix: Tags now have a proper drop target size

This commit is contained in:
Tom Najdek 2023-11-29 13:48:02 +01:00 committed by Dan Stillman
parent 8627e92cb4
commit f67efc90f1

View file

@ -589,10 +589,10 @@ Zotero.TagSelector = class TagSelectorContainer extends React.PureComponent {
return; return;
} }
var elem = event.target; let elem = event.target.closest('.tag-selector-item');
// Ignore drops not on tags // Ignore drops not on tags
if (!elem.classList.contains('tag-selector-item')) { if (elem === null) {
return; return;
} }
@ -603,13 +603,13 @@ Zotero.TagSelector = class TagSelectorContainer extends React.PureComponent {
event.dataTransfer.dropEffect = remove ? "move" : "copy"; event.dataTransfer.dropEffect = remove ? "move" : "copy";
}, },
onDragExit: function (event) { onDragExit: function (event) {
event.target.classList.remove('dragged-over'); event.target.closest('.tag-selector-item')?.classList?.remove?.('dragged-over');
}, },
onDrop: async function(event) { onDrop: async function(event) {
var elem = event.target; let elem = event.target.closest('.tag-selector-item');
// Ignore drops not on tags // Ignore drops not on tags
if (!elem.classList.contains('tag-selector-item')) { if (elem === null) {
return; return;
} }