Skip to content

Commit

Permalink
fix: compute dropped file path before css handling (#3595)
Browse files Browse the repository at this point in the history
* fix: compute dropped file path before css handling

* udpate changelog

* Update website/src/pages/changelog.mdx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 10, 2024
1 parent 3204287 commit ffcfa1b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
20 changes: 10 additions & 10 deletions v2/internal/frontend/runtime/desktop/draganddrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,6 @@ function onDrop(e) {
}
e.preventDefault();

if (!flags.useDropTarget) {
return;
}

// Trigger debounce function to deactivate drop targets
if(flags.nextDeactivate) flags.nextDeactivate();

// Deactivate all drop targets
Array.from(document.getElementsByClassName(DROP_TARGET_ACTIVE)).forEach(el => el.classList.remove(DROP_TARGET_ACTIVE));

if (CanResolveFilePaths()) {
// process files
let files = [];
Expand All @@ -154,6 +144,16 @@ function onDrop(e) {
}
window.runtime.ResolveFilePaths(e.x, e.y, files);
}

if (!flags.useDropTarget) {
return;
}

// Trigger debounce function to deactivate drop targets
if(flags.nextDeactivate) flags.nextDeactivate();

// Deactivate all drop targets
Array.from(document.getElementsByClassName(DROP_TARGET_ACTIVE)).forEach(el => el.classList.remove(DROP_TARGET_ACTIVE));
}

/**
Expand Down
14 changes: 7 additions & 7 deletions v2/internal/frontend/runtime/runtime_debug_desktop.js

Large diffs are not rendered by default.

Loading

0 comments on commit ffcfa1b

Please sign in to comment.