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

[beforeinput] Rename drag&drop to deleteByDrag&insertFromDrop #147

Closed
chong-z opened this issue Aug 24, 2016 · 4 comments
Closed

[beforeinput] Rename drag&drop to deleteByDrag&insertFromDrop #147

chong-z opened this issue Aug 24, 2016 · 4 comments

Comments

@chong-z
Copy link

chong-z commented Aug 24, 2016

We should use the name deleteByDrag&insertFromDrop to make it clear that the event is only for DOM modification. (e.g. Preventing deleteByDrag won't stop the drag&drop process)

Background:
Assume we all agree that InputEvent should only focus on DOM modification #144 (comment), and we are renaming cut&paste to deleteByCut&insertFromPaste.

@johanneswilm
Copy link
Contributor

Right. What about the dataTransfer object? Should we keep that? In some ways it seems to be similar to clipboard operations.

@chong-z
Copy link
Author

chong-z commented Aug 24, 2016

I would imagine we could have:

  1. dataTransfer=NULL for both deleteByDrag and deleteByCut, and
  2. dataTransfer=|data to insert| for insertFromDrop and insertFromPaste.

Does that sounds reasonable?

But for 2., should dataTransfer be the

  1. Raw data from clipboard/drag, or
  2. The fragment to be put on DOM?

e.g. The raw data could be <meta charset='utf-8'><h1 style="........">header</h1>, but the fragment being actually inserted could be just <h1>header</h1>.

I would vote for 1. Raw data since JS could put their own stuff, but this might not be consistence with beforeinput's definition?

@johanneswilm
Copy link
Contributor

Hey, yes, it definitely needs to be 1 as the JS may decide to do something completely different with it and it should have access to the most "original" version of the data available.

Did you guys come to a conclusion on whether or not we can create both the dragend- and drop-based beforeinput events? If I recall correctly the plan was for the Chrome team to check their source code on whether it's viable to have both events.

@johanneswilm
Copy link
Contributor

This issue was moved to w3c/input-events#19

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

2 participants