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

Drop file here to upload does not work in Safari #7420

Closed
aaronraimist opened this issue Sep 29, 2018 · 2 comments · Fixed by matrix-org/matrix-react-sdk#5414
Closed

Drop file here to upload does not work in Safari #7420

aaronraimist opened this issue Sep 29, 2018 · 2 comments · Fixed by matrix-org/matrix-react-sdk#5414
Assignees
Labels
P2 S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Z-Platform-Specific

Comments

@aaronraimist
Copy link
Collaborator

Description

Can't drag and drop a file into Safari

Steps to reproduce

  • Open Riot in Safari
  • Drag a file over the room

Describe how what happens differs from what you expected.

Riot should show "Drop file here to upload", instead nothing happens and I can't drag the file in to upload it.

Log: not sent

Version information

  • Platform: web

For the web app:

  • Browser: Safari Technology Preview Release 66 (Safari 12.1, WebKit 13607.1.7.2)
    ALSO
    Safari Version 12.0 (13606.2.11)
  • OS: macOS 10.13.6
  • URL: riot.im/develop
@aaronraimist
Copy link
Collaborator Author

Looks like Safari doesn't support https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList. Other websites seem to support drag and drop file in Safari though so I'm going to look in to how they do it.

@t3chguy
Copy link
Member

t3chguy commented Nov 10, 2020

What is happening is for Privacy Safari is saying 0 files are being dragged on dragOver event, other browsers say quantity and type here. https://stackoverflow.com/a/34866211

WhatWG agrees https://html.spec.whatwg.org/multipage/dnd.html#the-datatransfer-interface

This version of the API does not expose the types of the files during the drag.

Instead we can check the types property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Z-Platform-Specific
Projects
None yet
3 participants