[fix] Clipboard preserves line breaks

Fix #979
This commit is contained in:
Nicolas Gallagher
2018-06-01 11:57:23 -07:00
parent c336995952
commit 14f7dfd515

View File

@@ -27,8 +27,9 @@ export default class Clipboard {
// add the text to a hidden node
const node = document.createElement('span');
node.textContent = text;
node.style.position = 'absolute';
node.style.opacity = '0';
node.style.position = 'absolute';
node.style.whiteSpace = 'pre-wrap';
body.appendChild(node);
// select the text