Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
IR-1922 file processing bug on drag/drop (#10285)
Browse files Browse the repository at this point in the history
* fixing issue where if a file name was processed (for spaces or as a folder with a trailing '/') an if statement would execute and add an extra folder/filename string ("v v.mp4" would become "v%20v.mp4v v.mp4"...a folder "../test" would become "../test/test"

* mirroring filename fix to new studio
  • Loading branch information
SamMazerIR authored May 31, 2024
1 parent c76d98b commit c14d77c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
8 changes: 1 addition & 7 deletions packages/editor/src/components/inputs/FileBrowserInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,7 @@ export function FileBrowserInput({
async drop(item: any, monitor) {
const isDropType = acceptDropItems.find((element) => element === item.type)
if (isDropType) {
// Below url fix is applied when item is folder
let url = item.url
if (!url.endsWith(item.fullName)) {
url += item.fullName
}

onRelease?.(url)
onRelease?.(item.url)
} else {
// https://github.com/react-dnd/react-dnd/issues/1345#issuecomment-538728576
const dndItem: any = monitor.getItem()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,7 @@ export function FileBrowserInput({
async drop(item: any, monitor) {
const isDropType = acceptDropItems.find((element) => element === item.type)
if (isDropType) {
// Below url fix is applied when item is folder
let url = item.url
if (!url.endsWith(item.fullName)) {
url += item.fullName
}

onRelease?.(url)
onRelease?.(item.url)
} else {
// https://github.com/react-dnd/react-dnd/issues/1345#issuecomment-538728576
const dndItem: any = monitor.getItem()
Expand Down

0 comments on commit c14d77c

Please sign in to comment.