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:
parent
d12bdb1075
commit
7d6ede8dc6
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue