document.execCommand "insertText" can't paste text including '\r\n' string:
Reported by
samoylen...@gmail.com,
Dec 3 2016
|
|||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36 Steps to reproduce the problem: 1. Open in chrome html page attached [chromeIssue.html] (there is - span element with [contenteditable] attribute and [white-space: pre-wrap;] css style) - button "insert text" 2. Click the button (onclick event of the button subscribed to the function which inserts into the span the text with windows line breaks['\r\n'] using document.execCommand function.) What is the expected behavior? The 6 lines of text appears in the span element What went wrong? The text appears in the span element with extra empty lines after 3, 4, 5 and 6th lines of the text. Did this work before? N/A Chrome version: 54.0.2840.99 Channel: stable OS Version: 6.3 Flash Version: Shockwave Flash 23.0 r0 The bug reproduced for contenteditable elements with the [white-space: pre-wrap;] css style. Reproduced if element is empty or if the cursor at the end of the text in the element.
,
Dec 5 2016
,
Dec 6 2016
Able to reproduce the issue on Windows 10, Mac 10.12.1 and Ubuntu 14.04 using chrome reported version #54.0.2840.99 and latest canary #57.0.2942.0. Bisect Information: ===================== Good build: 44.0.2359.0 Revision(324003) Bad Build : 44.0.2360.0 Revision(324194) Change Log URL: https://chromium.googlesource.com/chromium/src/+log/de446058f8bb18cdae0ef9395b76ac0d1c1b8f26..d6aece7c6748553aa11b9dbacd27b5ec4d2d363c Blink Change Log: https://chromium.googlesource.com/chromium/blink/+log/0cdfa90..f36d5e0 Unable to find any suspect from the above blink change log. Could anyone from the dev team please help us in assigning it to the right owner. Thanks...!!
,
Dec 6 2016
,
Jan 12 2017
I found more serious issue: execCommand can't paste text including '\r\n' string:
<span id="edit" contenteditable="true"></span>
<script>
var elem = document.getElementById('edit');
elem.focus();
document.execCommand("insertText", false, "foo\r\nbar");
</script>
Expected:
foo
bar
Actual;
foo
Edge, FF works well.
,
Oct 4 2017
,
Nov 13 2017
,
Nov 14
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Nov 19
|
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by dtapu...@chromium.org
, Dec 5 2016