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

We should keep data in UI events for beforeInput that does the text/plain serialization. We should add dataTransfer to the editing spec for other mime types(html, text with line breaks, etc) #106

Closed
gked opened this issue Jan 13, 2016 · 4 comments

Comments

@gked
Copy link

gked commented Jan 13, 2016

No description provided.

@johanneswilm
Copy link
Contributor

Under what circumstances will we have richtext content? Is this for dragging/dropping? So far we don't have a beforeInput event for pasting.

@gked
Copy link
Author

gked commented Feb 4, 2016

These are basically undo/redo/copy/paste user input types and we should be able to handle cases when there is rich text invlolved.

@johanneswilm
Copy link
Contributor

@gked: The dataTransfer attribute for dragging usually depends on the setData method to specify what the piece of data that is to be dragged is to be. From you description of it, it sounds as if the dataTransfer attribute it to be a DataTransfer instance with the html version of the data already set (doing something like setData('text/html', element.outerHTML) ).

@johanneswilm
Copy link
Contributor

johanneswilm commented Jul 15, 2016

@hallvors I have been testing quite a bit and read through all I could find about the selection API and dataTransfer.

Please let me know if you agree with the following assessment:

  1. The cut/copy events of the clipboard API are in a sense beforeinput events as they should (if implemented correctly) allow for the script author to change the content of what is being copied before it actually hits the clipboard (in the case of copy and cut).
  2. Paste can also be influenced, but not by using setData. Instead, one has to prevent the event and handle the paste manually.

Correct?

It seems there are two main directions we could go:

  1. Make beforeinput(inputtype:'copy') be another way of listening to the copy event (is this even possible/common practice?). The advantage of this would be to only have to listen to the beforeinput event. Also, whatever functionality we come up with to limit context menus, etc., may be easier to make work this way.
  2. Keep all the clipboard events separate from the beforeinput events. Advantage is that we don't need to touch the clipboard API very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants