mirror of
https://github.com/penpot/penpot.git
synced 2026-04-28 04:38:14 +00:00
🐛 Fix paste error on single line pastes
This commit is contained in:
parent
99b40cecf2
commit
0c3cc20522
@ -1057,7 +1057,7 @@ export class SelectionController extends EventTarget {
|
||||
fragment.children.length === 1 &&
|
||||
fragment.firstElementChild?.dataset?.inline === "force"
|
||||
) {
|
||||
const collapseNode = fragment.lastElementChild.firstChild;
|
||||
const collapseNode = fragment.lastElementChild.firstChild.firstChild;
|
||||
if (this.isInlineStart) {
|
||||
this.focusInline.before(...fragment.firstElementChild.children);
|
||||
} else if (this.isInlineEnd) {
|
||||
@ -1382,10 +1382,13 @@ export class SelectionController extends EventTarget {
|
||||
*/
|
||||
insertParagraph() {
|
||||
if (this.isParagraphEnd) {
|
||||
console.log('a')
|
||||
return this.insertParagraphAfter();
|
||||
} else if (this.isParagraphStart) {
|
||||
console.log('b')
|
||||
return this.insertParagraphBefore();
|
||||
}
|
||||
console.log('c')
|
||||
return this.splitParagraph();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user