mirror of
https://github.com/penpot/penpot.git
synced 2025-05-24 06:36:10 +02:00
🐛 Fix pasting adds a newline (#5763)
This commit is contained in:
parent
b913c75c41
commit
1f2e36774e
1 changed files with 6 additions and 0 deletions
|
@ -1066,9 +1066,15 @@ export class SelectionController extends EventTarget {
|
||||||
}
|
}
|
||||||
const collapseNode = fragment.lastElementChild.lastElementChild.firstChild
|
const collapseNode = fragment.lastElementChild.lastElementChild.firstChild
|
||||||
if (this.isParagraphStart) {
|
if (this.isParagraphStart) {
|
||||||
|
const a = fragment.lastElementChild;
|
||||||
|
const b = this.focusParagraph;
|
||||||
this.focusParagraph.before(fragment);
|
this.focusParagraph.before(fragment);
|
||||||
|
mergeParagraphs(a, b);
|
||||||
} else if (this.isParagraphEnd) {
|
} else if (this.isParagraphEnd) {
|
||||||
|
const a = this.focusParagraph;
|
||||||
|
const b = fragment.firstElementChild;
|
||||||
this.focusParagraph.after(fragment);
|
this.focusParagraph.after(fragment);
|
||||||
|
mergeParagraphs(a, b);
|
||||||
} else {
|
} else {
|
||||||
const newParagraph = splitParagraph(
|
const newParagraph = splitParagraph(
|
||||||
this.focusParagraph,
|
this.focusParagraph,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue