FileSystemConfiguration: Don't stop onDragOver if element matches

Rely on the index matching instead. During a drag, if onDragOver is
fired the index the item will be dragged to (the target index) will be
set. If the target index doesn't match the source index, the new
tempItemOrder is made and the new target index is set.

Initially this index is null, so even if the target index is the
same as the current index, the tempItemOrder and target index will be
set once.

By not shorting this event based on the visual layout, the drag state
gets initialized correctly every time.

Fixes #679
This commit is contained in:
Sanne Raymaekers 2022-04-01 13:39:23 +02:00 committed by jkozol
parent d12bdb1075
commit 7d6ede8dc6

View file

@ -141,7 +141,7 @@ const FileSystemConfiguration = ({ ...props }) => {
evt.preventDefault();
const curListItem = evt.target.closest('tr');
if (!curListItem || !bodyref.current.contains(curListItem) || curListItem.id === draggedItemId) {
if (!curListItem || !bodyref.current.contains(curListItem)) {
return null;
}