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

File icon + file name can be dragged and triggers drag&drop upload overlay #931

Open
tomasmatus opened this issue Feb 5, 2025 · 1 comment · May be fixed by #941
Open

File icon + file name can be dragged and triggers drag&drop upload overlay #931

tomasmatus opened this issue Feb 5, 2025 · 1 comment · May be fixed by #941
Labels
bug Something isn't working

Comments

@tomasmatus
Copy link
Member

The whole <a ...> element can be dragged which triggers the drag & drop upload overlay.
Dropping the file doesn't seem to upload anything so that's good.

Image

@jelly jelly added the bug Something isn't working label Feb 5, 2025
@tomasmatus
Copy link
Member Author

Ok so using draggable="false" won't do the trick, text can still be selected and then dragged which triggers the overlay too.
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/draggable

I'll look into the events if I can somehow tell the difference and not show the overlay on some specific dragenter events. I don't think this is doable though.

tomasmatus added a commit to tomasmatus/cockpit-files that referenced this issue Feb 10, 2025
fixes: cockpit-project#931

As stated in https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/types

"If any files are included in the drag operation,
then one of the types will be the string Files."
@tomasmatus tomasmatus linked a pull request Feb 10, 2025 that will close this issue
tomasmatus added a commit to tomasmatus/cockpit-files that referenced this issue Feb 11, 2025
fixes: cockpit-project#931

As stated in https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/types

"If any files are included in the drag operation,
then one of the types will be the string Files."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants