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

Datatransfer additions, see #120 #128

Merged
merged 6 commits into from
Dec 14, 2021
Merged

Conversation

johanneswilm
Copy link
Contributor

@johanneswilm johanneswilm commented Dec 10, 2021

Copy link
Member

@saschanaz saschanaz left a comment

Choose a reason for hiding this comment

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

I don't have a string opinion about the change itself, I believe either @masayuki-nakano or @mbrodesser would want to take a look at that part.

(Gecko doesn't seem to add a File to DataTransfer when I copy a png file to a contenteditable on Windows desktop, which is different from what #120 said. It does add one when DND happens.)

index.html Outdated Show resolved Hide resolved
@johanneswilm
Copy link
Contributor Author

@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
Copy link
Contributor Author

johanneswilm commented Dec 14, 2021

@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
Copy link
Member

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 and others added 2 commits December 14, 2021 23:01
Co-authored-by: Kagami Sascha Rosylight <saschanaz@outlook.com>
This reverts commit cb6ea10.
@johanneswilm
Copy link
Contributor Author

johanneswilm commented Dec 14, 2021

@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
Copy link
Member

Fixed it myself 👍

<a data-cite=
"html/dnd.html#the-drag-data-item-kind">kind</a> is
<i>File</i>, and whose data is a <a data-cite="FileAPI#dfn-file">File object</a>
corresponding to the pasted file. [[HTML]]
Copy link
Member

Choose a reason for hiding this comment

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

BTW, we don't need [[HTML]] here when xref already includes it.

Copy link
Member

@saschanaz saschanaz left a comment

Choose a reason for hiding this comment

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

Approving, mostly for the syntax.

@johanneswilm johanneswilm merged commit 16e220c into gh-pages Dec 14, 2021
@johanneswilm johanneswilm deleted the datatransfer-additions branch December 14, 2021 22:51
@mbrodesser
Copy link

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

@johanneswilm
Copy link
Contributor Author

johanneswilm commented Dec 16, 2021 via email

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

Successfully merging this pull request may close these issues.

None yet

3 participants