Fix: Tags now have a proper drop target size
This commit is contained in:
parent
8627e92cb4
commit
f67efc90f1
1 changed files with 5 additions and 5 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue