Bug 255150 - REGRESSION (Safari 16.4): clipboardData.setData removes newlines when : is in the line
Summary: REGRESSION (Safari 16.4): clipboardData.setData removes newlines when : is in...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: Safari 16
Hardware: Mac (Intel) macOS 12
: P2 Critical
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-04-07 07:13 PDT by Nanne Wielinga
Modified: 2023-04-12 01:42 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nanne Wielinga 2023-04-07 07:13:39 PDT
Browser Safari 16.4, the bug was not present in 16.3
Related: https://github.com/ajaxorg/ace/issues/5112

This bug breaks copying YAML or Python code from online code editors (Ace, CodeMirror, and Monaco).

When testing, two scenarios:

clipboardData.setData("text/plain", `test1\ntest2\ntest3`)

Results into:

test1
test2
test3

And:

clipboardData.setData("text/plain", `test: 1\ntest2\ntest3`)

Results into:

test: 1test2test3

Eating up all the enters

Example: https://jsfiddle.net/102g5phr/ (updated)
Comment 1 Alexey Proskuryakov 2023-04-08 18:12:27 PDT
Could you please try Safari Technology Preview 167? I cannot reproduce with a newer Safari version, so I suspect that this was fixed as part of bug 250119.
Comment 2 Radar WebKit Bug Importer 2023-04-08 18:12:36 PDT
<rdar://problem/107796207>
Comment 3 Nanne Wielinga 2023-04-12 01:42:24 PDT
Yes, Safari Technology Preview 167 resolves the issue.