w3c / input-events

Input Events
https://w3c.github.io/input-events/
Other
24 stars 16 forks source link

Datatransfer additions, see #120 #128

Closed johanneswilm closed 2 years ago

johanneswilm commented 2 years ago

Preview | Diff

johanneswilm commented 2 years ago

@saschanaz This is a change that was decided upon at the November call. We tested it and found the file in Chrome and Firefox but not in Safari. We add this here to make it behave the same everywhere.

johanneswilm commented 2 years ago

@saschanaz I just tried again on Ubuntu, and Firefox did show the file. Let's try to make sure we follow the exact same procedure to test this. I did this:

  1. Go to https://johanneswilm.github.io/input-events-testing/index.html
  2. Enable the developer console
  3. In a second tab, go to https://www.w3.org/
  4. On the first image in the middle row, right-click and select "copy".
  5. Go back to the first tab and paste the image in the contenteditable element (right under the title "Input events tests") by clicking into it and then typing ctrl+v.
  6. Inspect the output for the beforeinput event in the developer console.
saschanaz commented 2 years ago

With those steps I do get a file object from DataTransfer. Probably a bug that it doesn't work as such for desktop files (while Chrome does give a file.)

johanneswilm commented 2 years ago

@saschanaz It seems like using [=xref=] broke it, so I have reverted that for now. Do you want to try doing that in some other way in this PR, or should we just make it part of a more generic PR to solve #129?

saschanaz commented 2 years ago

Fixed it myself 👍

mbrodesser commented 2 years ago

CC @evilpies, as this might be interesting for you.

johanneswilm commented 2 years ago

Hey @mbrodesser,

On Thu, Dec 16, 2021 at 11:13 AM mbrodesser @.***> wrote:

@johanneswilm https://github.com/johanneswilm: can you please explain why the "text/uri-list" entry was added in this PR? The explanation in #128 (comment) https://github.com/w3c/input-events/pull/128#issuecomment-993212028 doesn't cover that. It seems neither Chrome nor Firefox currently support this, at least on Ubuntu 20.04.

I was basing this on the outcome of the November call [1] . But you're right, the last few comments there before the action indicate though that we should possibly make it more platform dependent to match the data transfer object of the paste event. Not sure how we would word that. I'm open for suggestions.

[1] https://www.w3.org/2021/11/12-editing-minutes.html#a02 -- Johannes Wilm