Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(files): prevent dragging previews and appear as an external files DnD #42840

Merged
merged 2 commits into from
Jan 17, 2024

Conversation

skjnldsv
Copy link
Member

Fix #42751

If you drag the preview, the event will carry the image as File data.
This fixes that issue. Now every FileEntry drag will appear as internal and NOT show the Drop area

Before:

296437576-f7f62e48-af9d-4484-978d-b6f0bc16fc85.mp4

@skjnldsv skjnldsv added this to the Nextcloud 29 milestone Jan 16, 2024
@skjnldsv skjnldsv requested a review from a team January 16, 2024 11:14
@skjnldsv skjnldsv self-assigned this Jan 16, 2024
@skjnldsv skjnldsv requested review from Fenn-CS, szaimen and sorbaugh and removed request for a team January 16, 2024 11:14
@skjnldsv skjnldsv requested a review from artonge January 16, 2024 11:21
Copy link
Contributor

@artonge artonge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That almost looks like a feature !

Isn't the fix a bit hacky? Is this method really made for those use cases?
Can we use that instead? https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/draggable

@skjnldsv
Copy link
Member Author

Isn't the fix a bit hacky ?
Can we use that instead? developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/draggable

I think it's actually the cleanest approach. We want to clear all data if the drag comes from an internal file. If I add the draggable to the img, there's no guarantee the issue won't come back in a few months after we discover another element that also carry a file when dragged (an action, maybe even the shared status user's avatar 🤔)

Cleanest is to only carry the dragging event imho :)

@skjnldsv skjnldsv requested a review from artonge January 17, 2024 06:50
Copy link
Contributor

@artonge artonge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I think I get the fix now, it makes sense :).

@pierre-alain-b
Copy link

Hello all, thank you for the fix. I see this is marked for NC 29. As this is disturbing the use of NC 28, wouldn't it be wise to push it for the next maintenance release of NC28 ?

@skjnldsv
Copy link
Member Author

@pierre-alain-b master is 29, this will get backported to 28 after merge

@skjnldsv
Copy link
Member Author

/skjnldsv-backport to stable28

… DnD

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
@susnux
Copy link
Contributor

susnux commented Jan 17, 2024

/compile

1 similar comment
@susnux
Copy link
Contributor

susnux commented Jan 17, 2024

/compile

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@susnux susnux merged commit ef41104 into master Jan 17, 2024
42 checks passed
@susnux susnux deleted the fix/dnd-files branch January 17, 2024 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Moving NC Files using drag&drop
5 participants