{"action":"created","issue":{"url":"https://api.github.com/repos/w3c/editing/issues/144","repository_url":"https://api.github.com/repos/w3c/editing","labels_url":"https://api.github.com/repos/w3c/editing/issues/144/labels{/name}","comments_url":"https://api.github.com/repos/w3c/editing/issues/144/comments","events_url":"https://api.github.com/repos/w3c/editing/issues/144/events","html_url":"https://github.com/w3c/editing/issues/144","id":171510435,"number":144,"title":"[beforeinput] PreventDefault() on InputType=cut differs from Clipboard API","user":{"login":"choniong","id":2839070,"avatar_url":"https://avatars.githubusercontent.com/u/2839070?v=3","gravatar_id":"","url":"https://api.github.com/users/choniong","html_url":"https://github.com/choniong","followers_url":"https://api.github.com/users/choniong/followers","following_url":"https://api.github.com/users/choniong/following{/other_user}","gists_url":"https://api.github.com/users/choniong/gists{/gist_id}","starred_url":"https://api.github.com/users/choniong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/choniong/subscriptions","organizations_url":"https://api.github.com/users/choniong/orgs","repos_url":"https://api.github.com/users/choniong/repos","events_url":"https://api.github.com/users/choniong/events{/privacy}","received_events_url":"https://api.github.com/users/choniong/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/w3c/editing/labels/InputEvents","name":"InputEvents","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-08-16T20:32:45Z","updated_at":"2016-08-16T22:27:28Z","closed_at":null,"body":"If I recall correctly the outcome from the F2F is:\r\n\r\n1. [`Cut` and `paste` are effectively the same as beforeinput](https://docs.google.com/document/d/1XxIEF0So-kMF5mcJ03Yj0zsYMFRHEgXw1fV1K5FOwuQ/edit#heading=h.l9vlzb1oc68r)\r\n2. [Canceling 'beforeinput' prevents clipboard update](https://github.com/w3c/editing/issues/135#issuecomment-236702797)\r\n\r\nBut according to [Clipboard API](https://w3c.github.io/clipboard-apis/#the-cut-action) canceling `cut` does not prevents clipboard update. Instead it writes user-modified data into clipboard.\r\n\r\nTo solve the conflicts the possible solutions are (For `InputType=cut`):\r\n\r\na. Set `'beforeinput'.dataTransfer=NULL`,  preventing default will prevent everything.\r\nb. `'beforeinput'` shares the same `DataTransfer` object with `Clipboard::Cut`, and does the same thing\r\nc. Set `'beforeinput'.dataTransfer=Readonly-Data-To-Be-Cut`, preventing default will prevent everything.\r\n\r\nPersonally I'd perfer a) since JS can always get data from selection, and we can add `dataTransfer` later if it's really useful."},"comment":{"url":"https://api.github.com/repos/w3c/editing/issues/comments/240259209","html_url":"https://github.com/w3c/editing/issues/144#issuecomment-240259209","issue_url":"https://api.github.com/repos/w3c/editing/issues/144","id":240259209,"user":{"login":"johanneswilm","id":595512,"avatar_url":"https://avatars.githubusercontent.com/u/595512?v=3","gravatar_id":"","url":"https://api.github.com/users/johanneswilm","html_url":"https://github.com/johanneswilm","followers_url":"https://api.github.com/users/johanneswilm/followers","following_url":"https://api.github.com/users/johanneswilm/following{/other_user}","gists_url":"https://api.github.com/users/johanneswilm/gists{/gist_id}","starred_url":"https://api.github.com/users/johanneswilm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanneswilm/subscriptions","organizations_url":"https://api.github.com/users/johanneswilm/orgs","repos_url":"https://api.github.com/users/johanneswilm/repos","events_url":"https://api.github.com/users/johanneswilm/events{/privacy}","received_events_url":"https://api.github.com/users/johanneswilm/received_events","type":"User","site_admin":false},"created_at":"2016-08-16T22:27:28Z","updated_at":"2016-08-16T22:27:28Z","body":"> Yes, choosing A or C requires additional work for global clipboard.\r\n\r\n> I cannot remember how we solved this issue during F2F, but the outcome is to prevent clipboard update. I just want to confirm is this still what we want?\r\n\r\nI think the way we solved it was that we all forgot how difficult it is to add content to the global clipboard, so we didn't think this was an issue. :)\r\n\r\nI think I agree with you that it's easier to do A now and then possible switch to C later on. \r\n\r\nAdditionally, we should file an issue with the Clipboard API (who is maintaining that now?) that there needs to be a added a method to add things to the clipboard without having to rely on execCommand and adding things to the DOM. This has been requested before, and here we have a good use case for this."}}
{"actor":{"display_login":"johanneswilm"}}