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

Encourage browsers to include files in beforeinput DataTransfer event #120

Open
wereHamster opened this issue Aug 24, 2021 · 2 comments
Open

Comments

@wereHamster
Copy link

Having the files available via DataTransfer of the beforeinput event (in the same way that they are available for example in the paste event) is extremely useful.

Files in DataTransfer are available in both Chrome and Firefox. WebKit is refusing to implement this feature citing essentially «it's not in the spec».

In the same spirit, browsers should include text/uri-list when appropriate given the clipboard contents.

WebKit Bugs:

@travisleithead travisleithead added the Agenda+ Queue this item for discussion at the next WG meeting label Aug 26, 2021
@johanneswilm johanneswilm added Agenda+ Queue this item for discussion at the next WG meeting and removed Agenda+ Queue this item for discussion at the next WG meeting labels Oct 29, 2021
@johanneswilm
Copy link
Contributor

johanneswilm commented Oct 29, 2021

I can confirm the description of @wereHamster. Pasting an PNG image that was copied from the web, creates an beforeInputEvent.dataTransfer with types ["text/plain", "text/html"] and no files attached on Safari 14.1.2 while on the other browsers it does create a event.dataTransfer with types ["text/html", "Files"] and the pasted image file is accessible at beforeInputEvent.dataTransfer.files[0].

@css-meeting-bot
Copy link
Member

The Web Editing Working Group just discussed Encourage browser to include files in beforeinput DataTransfer event (#120).

The full IRC log of that discussion <Travis> topic: Encourage browser to include files in beforeinput DataTransfer event (#120)
<Travis> johanneswilm: had a followup with @wereHamster to check if the behavior worked according to how the filer noted.
<Travis> .. so, yes it did.
<Travis> BoCupp: Request was to add support (like Safari)
<Travis> .. but like I said last time, wasn't a fan of having redundant info in beforeinput when we already have cut/copy events and async clipboard.
<Travis> .. so isn't clear why we need them... but we have them!
<Travis> .. request is for Safari to add them.
<Travis> .. I'm OK either way: remove them, or everyone adds them.
<Travis> github: https://github.com//issues/120
<Travis> johanneswilm: what was Safari's position?
<Travis> whsieh: we would not be opposed.
<Travis> .. can see the value if they were already using beforeinput... but there are more forward thinking alternatives.
<Travis> Travis: is there an action item?
<Travis> BoCupp: we could document that it's different in different browsers.. but would love to settle on one?
<Travis> .. whsieh want to pick?
<Travis> .. j/k
<Travis> whsieh: no reason why we ommitted it (except it wasn't originally in the spec).
<Travis> .. seems sensible to add.
<Travis> .. two parts to this.. 1) .files and...
<Travis> .. oh, another thing: the .items function here...
<Travis> .. wondering if it should also be in datatransferlist
<whsieh> text/uri-list
<Travis> .. and 2) textURI-list
<Travis> BoCupp: For #2 above, is it clear we should copy that?
<Travis> whsieh: hmm... it should be consistent with copy/paste APIs... may be platform dependent.
<Travis> .. in Safari, copy/paste the URL in the browser, you get a URL on the pasteboard..
<Travis> BoCupp: Is there clear guideance for the Mac on how to put it there?
<Travis> whsieh: the text/uri-list is really a hint for expecting...
<Travis> .. high-order bit--datatransfer should align with copy/paste events.
<Travis> BoCupp: right. You want the same information as in the preceding or following cut/copy/paste event
<Travis> action: we want the contents of datatransfer property on the input/beforeinput event to match the associated property of the copy/paste event (clipboard event).
<Travis> action: johanneswilm to update the spec text to ensure datatransfer property on the input/beforeinput event to match the associated property of the copy/paste event (clipboard event)

@johanneswilm johanneswilm removed the Agenda+ Queue this item for discussion at the next WG meeting label Dec 10, 2021
johanneswilm added a commit that referenced this issue Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants