{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/polymer-dart/issues/342","labels_url":"https://api.github.com/repos/dart-lang/polymer-dart/issues/342/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/polymer-dart/issues/342/comments","events_url":"https://api.github.com/repos/dart-lang/polymer-dart/issues/342/events","html_url":"https://github.com/dart-lang/polymer-dart/issues/342","id":85653700,"number":342,"title":"shadowRoot.getSelection() doesn't work properly inside polymer element","user":{"login":"DartBot","id":8958862,"avatar_url":"https://avatars.githubusercontent.com/u/8958862?v=3","gravatar_id":"","url":"https://api.github.com/users/DartBot","html_url":"https://github.com/DartBot","followers_url":"https://api.github.com/users/DartBot/followers","following_url":"https://api.github.com/users/DartBot/following{/other_user}","gists_url":"https://api.github.com/users/DartBot/gists{/gist_id}","starred_url":"https://api.github.com/users/DartBot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DartBot/subscriptions","organizations_url":"https://api.github.com/users/DartBot/orgs","repos_url":"https://api.github.com/users/DartBot/repos","events_url":"https://api.github.com/users/DartBot/events{/privacy}","received_events_url":"https://api.github.com/users/DartBot/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dart-lang/polymer-dart/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/dart-lang/polymer-dart/labels/duplicate","name":"duplicate","color":"cccccc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-06-05T23:10:42Z","updated_at":"2015-06-05T23:10:43Z","closed_at":null,"body":"<a href=\"https://github.com/RWander\"><img src=\"https://avatars.githubusercontent.com/u/2590778?v=3\" align=\"left\" width=\"96\" height=\"96\"hspace=\"10\"></img></a> **Issue by [RWander](https://github.com/RWander)**\n_Originally opened as dart-lang/sdk#21607_\n\n----\n\nPlease see the discussion on stack overflow::\n\nhttp://stackoverflow.com/questions/26926555/how-to-get-the-selected-text-or-the-inner-html-in-dart/\n\nGünter Zöchbauer wrote:\n\nprint(shadowRoot.getSelection().getRangeAt(0).cloneContents().innerHtml);\nprint(shadowRoot.getSelection().getRangeAt(0).cloneContents().text);\n\nI tried it with content outside the custom element, in the shadow DOM of the element and as child of the custom Element.\n\nThere are some issues what can be selected when the selection crosses the shadow boundary (immediately selects the entire content of the shadow DOM. Beside from that document.getSelection() and shadowRoot.getSelection() always return the same result.\n\nIt seems getSelection doesn't work when the end (mouse-up) is within the shadow DOM. When the selection starts in the shadow DOM and ends in the (child) content it works but not the other way around.\n\nI think this is a bug.\n\n\nIf this bug is in Polymer.js please move it to GitHub. Thanks!"},"comment":{"url":"https://api.github.com/repos/dart-lang/polymer-dart/issues/comments/109475834","html_url":"https://github.com/dart-lang/polymer-dart/issues/342#issuecomment-109475834","issue_url":"https://api.github.com/repos/dart-lang/polymer-dart/issues/342","id":109475834,"user":{"login":"DartBot","id":8958862,"avatar_url":"https://avatars.githubusercontent.com/u/8958862?v=3","gravatar_id":"","url":"https://api.github.com/users/DartBot","html_url":"https://github.com/DartBot","followers_url":"https://api.github.com/users/DartBot/followers","following_url":"https://api.github.com/users/DartBot/following{/other_user}","gists_url":"https://api.github.com/users/DartBot/gists{/gist_id}","starred_url":"https://api.github.com/users/DartBot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DartBot/subscriptions","organizations_url":"https://api.github.com/users/DartBot/orgs","repos_url":"https://api.github.com/users/DartBot/repos","events_url":"https://api.github.com/users/DartBot/events{/privacy}","received_events_url":"https://api.github.com/users/DartBot/received_events","type":"User","site_admin":false},"created_at":"2015-06-05T23:10:42Z","updated_at":"2015-06-05T23:10:42Z","body":"<a href=\"https://github.com/jakemac53\"><img src=\"https://avatars.githubusercontent.com/u/984921?v=3\" align=\"left\" width=\"48\" height=\"48\"hspace=\"10\"></img></a> **Comment by [jakemac53](https://github.com/jakemac53)**\n\n----\n\nhttp://jsbin.com/saxalejuqi/1/edit?html,output is a pure js repro. You can't select at all across the shadow boundary."}}