Explorar o código

[filebrowser] Unselect items when d&d a new item

Clément Espeute hai 2 meses
pai
achega
dffdbd2d40
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      hide/comp/FancyGallery.hx

+ 5 - 0
hide/comp/FancyGallery.hx

@@ -372,6 +372,11 @@ class FancyGallery<GalleryItem> extends hide.comp.Component {
 
 		data.element.draggable = true;
 		data.element.ondragstart = (e:js.html.DragEvent) -> {
+			if (!selection.get(cast data)) {
+				clearSelection();
+				setSelection(data, true);
+			}
+
 			if (dragAndDropInterface.onDragStart(data.item, e.dataTransfer)) {
 				e.dataTransfer.effectAllowed = "move";
 				e.dataTransfer.setDragImage(data.element, 0,0);