Bug 186347
Summary: | Empty selection with readonly contenteditable element | ||
---|---|---|---|
Product: | WebKit | Reporter: | Jacek Bogdański <j.bogdanski> |
Component: | HTML Editing | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | megan_gardner, rniwa, webkit-bug-importer, wenson_hsieh |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 11 | ||
Hardware: | iPhone / iPad | ||
OS: | iOS 11 |
Jacek Bogdański
Hello,
we struggle with an issue with document.getSelection() function when selected text is inside element with contenteditable=false attribute. Returned selection doesn't contain information about selected text. As a result, you cannot, for example, copy current selection using document.execCommand('copy') function.
Steps to reproduce:
1. Visit https://codepen.io/jacekbogdanski/pen/wXMORq using iPad.
2. Use Safari developer tools with iPad.
3. Select some text from Lorem Ipsum example using iPad.
4. Click `Execute` link.
Expected:
Selection object should contain information about currently selected text.
Actual:
Selection object doesn't contain information about current selection.
Other:
It seems like this issue occurs only with contenteditable elements. It works fine with simple div element or contenteditable=true.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/42941462>