Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Cannot move a directory to its upper neighbor empty folder by dragging #1362

Open
aminya opened this issue Oct 14, 2020 · 1 comment
Open

Comments

@aminya
Copy link

aminya commented Oct 14, 2020

Summary

I cannot move a directory to its upper folder by dragging when the neighbor is empty. It works to all other folders, but not the upper neighbor. It works if the folder is not empty.

tree-view

This happens on 1.54.0-nightly1 or 1.51.0

@aminya aminya changed the title Cannot move a directory to its upper neighbor folder by dragging Cannot move a directory to its upper neighbor empty folder by dragging Oct 14, 2020
@aminya
Copy link
Author

aminya commented Oct 14, 2020

I debugged the code. The issue is that the drag-over class is constantly removed or added when I drag over the upper neighbor. But for all others, the class stays what it should be.

tree-view-debug

These two methods do this:

tree-view/lib/tree-view.coffee

Lines 1051 to 1075 in bf1181d

onDragEnter: (e) =>
if entry = e.target.closest('.entry.directory')
return if @rootDragAndDrop.isDragging(e)
return unless @isAtomTreeViewEvent(e)
e.stopPropagation()
@dragEventCounts.set(entry, 0) unless @dragEventCounts.get(entry)
unless @dragEventCounts.get(entry) isnt 0 or entry.classList.contains('selected')
entry.classList.add('drag-over', 'selected')
@dragEventCounts.set(entry, @dragEventCounts.get(entry) + 1)
onDragLeave: (e) =>
if entry = e.target.closest('.entry.directory')
return if @rootDragAndDrop.isDragging(e)
return unless @isAtomTreeViewEvent(e)
e.stopPropagation()
@dragEventCounts.set(entry, @dragEventCounts.get(entry) - 1)
if @dragEventCounts.get(entry) is 0 and entry.classList.contains('drag-over')
entry.classList.remove('drag-over', 'selected')
# Handle entry name object dragstart event

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant