{"action":"created","issue":{"url":"https://api.github.com/repos/vaadin/vaadin-text-field/issues/214","repository_url":"https://api.github.com/repos/vaadin/vaadin-text-field","labels_url":"https://api.github.com/repos/vaadin/vaadin-text-field/issues/214/labels{/name}","comments_url":"https://api.github.com/repos/vaadin/vaadin-text-field/issues/214/comments","events_url":"https://api.github.com/repos/vaadin/vaadin-text-field/issues/214/events","html_url":"https://github.com/vaadin/vaadin-text-field/issues/214","id":310426934,"node_id":"MDU6SXNzdWUzMTA0MjY5MzQ=","number":214,"title":"Selection API","user":{"login":"heruan","id":851745,"node_id":"MDQ6VXNlcjg1MTc0NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/851745?v=4","gravatar_id":"","url":"https://api.github.com/users/heruan","html_url":"https://github.com/heruan","followers_url":"https://api.github.com/users/heruan/followers","following_url":"https://api.github.com/users/heruan/following{/other_user}","gists_url":"https://api.github.com/users/heruan/gists{/gist_id}","starred_url":"https://api.github.com/users/heruan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heruan/subscriptions","organizations_url":"https://api.github.com/users/heruan/orgs","repos_url":"https://api.github.com/users/heruan/repos","events_url":"https://api.github.com/users/heruan/events{/privacy}","received_events_url":"https://api.github.com/users/heruan/received_events","type":"User","site_admin":false},"labels":[{"id":527046136,"node_id":"MDU6TGFiZWw1MjcwNDYxMzY=","url":"https://api.github.com/repos/vaadin/vaadin-text-field/labels/in%20review","name":"in review","color":"ededed","default":false}],"state":"open","locked":false,"assignee":{"login":"jouni","id":66382,"node_id":"MDQ6VXNlcjY2Mzgy","avatar_url":"https://avatars3.githubusercontent.com/u/66382?v=4","gravatar_id":"","url":"https://api.github.com/users/jouni","html_url":"https://github.com/jouni","followers_url":"https://api.github.com/users/jouni/followers","following_url":"https://api.github.com/users/jouni/following{/other_user}","gists_url":"https://api.github.com/users/jouni/gists{/gist_id}","starred_url":"https://api.github.com/users/jouni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jouni/subscriptions","organizations_url":"https://api.github.com/users/jouni/orgs","repos_url":"https://api.github.com/users/jouni/repos","events_url":"https://api.github.com/users/jouni/events{/privacy}","received_events_url":"https://api.github.com/users/jouni/received_events","type":"User","site_admin":false},"assignees":[{"login":"jouni","id":66382,"node_id":"MDQ6VXNlcjY2Mzgy","avatar_url":"https://avatars3.githubusercontent.com/u/66382?v=4","gravatar_id":"","url":"https://api.github.com/users/jouni","html_url":"https://github.com/jouni","followers_url":"https://api.github.com/users/jouni/followers","following_url":"https://api.github.com/users/jouni/following{/other_user}","gists_url":"https://api.github.com/users/jouni/gists{/gist_id}","starred_url":"https://api.github.com/users/jouni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jouni/subscriptions","organizations_url":"https://api.github.com/users/jouni/orgs","repos_url":"https://api.github.com/users/jouni/repos","events_url":"https://api.github.com/users/jouni/events{/privacy}","received_events_url":"https://api.github.com/users/jouni/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-04-02T08:22:18Z","updated_at":"2018-09-19T20:54:53Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Originating from vaadin/vaadin-text-field-flow#65 what about methods to trigger the [setSelectionRange](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange) methods on the `input` field?\r\n\r\n```js\r\nsetSelectionRange(start, end, direction) {\r\n  this.focusElement.focus();\r\n  this.focusElement.setSelectionRange(start, end, direction);\r\n}\r\n\r\nselectAll() {\r\n  this.setSelectionRange(0, this.value.length);\r\n}\r\n\r\nclearSelection() {\r\n  this.setSelectionRange(0, 0);\r\n}\r\n```\r\n\r\nPlus, methods to trigger copy/cut actions on the `input`:\r\n\r\n```js\r\ncopyToClipboard() {\r\n  this.focusElement.focus();\r\n  document.execCommand('copy');\r\n}\r\n\r\ncutToClipboard() {\r\n  this.focusElement.focus();\r\n  document.execCommand('cut');\r\n}\r\n```\r\n\r\nUse case: https://jsfiddle.net/heruan/3Lhmgv8u/"},"comment":{"url":"https://api.github.com/repos/vaadin/vaadin-text-field/issues/comments/422955043","html_url":"https://github.com/vaadin/vaadin-text-field/issues/214#issuecomment-422955043","issue_url":"https://api.github.com/repos/vaadin/vaadin-text-field/issues/214","id":422955043,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMjk1NTA0Mw==","user":{"login":"jouni","id":66382,"node_id":"MDQ6VXNlcjY2Mzgy","avatar_url":"https://avatars3.githubusercontent.com/u/66382?v=4","gravatar_id":"","url":"https://api.github.com/users/jouni","html_url":"https://github.com/jouni","followers_url":"https://api.github.com/users/jouni/followers","following_url":"https://api.github.com/users/jouni/following{/other_user}","gists_url":"https://api.github.com/users/jouni/gists{/gist_id}","starred_url":"https://api.github.com/users/jouni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jouni/subscriptions","organizations_url":"https://api.github.com/users/jouni/orgs","repos_url":"https://api.github.com/users/jouni/repos","events_url":"https://api.github.com/users/jouni/events{/privacy}","received_events_url":"https://api.github.com/users/jouni/received_events","type":"User","site_admin":false},"created_at":"2018-09-19T20:54:53Z","updated_at":"2018-09-19T20:54:53Z","author_association":"MEMBER","body":"@heruan, no clipboard related APIs in my PR. I don’t have enough knowledge of those at the moment, and those felt like a separate topic and PR. You might want to open a separate issue to track that."}}
{"actor":{"display_login":"jouni"}}