mirror of
https://github.com/penpot/penpot.git
synced 2026-08-01 19:06:18 +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.children.length === 1 &&
|
||||||
fragment.firstElementChild?.dataset?.inline === "force"
|
fragment.firstElementChild?.dataset?.inline === "force"
|
||||||
) {
|
) {
|
||||||
const collapseNode = fragment.lastElementChild.firstChild;
|
const collapseNode = fragment.lastElementChild.firstChild.firstChild;
|
||||||
if (this.isInlineStart) {
|
if (this.isInlineStart) {
|
||||||
this.focusInline.before(...fragment.firstElementChild.children);
|
this.focusInline.before(...fragment.firstElementChild.children);
|
||||||
} else if (this.isInlineEnd) {
|
} else if (this.isInlineEnd) {
|
||||||
@ -1382,10 +1382,13 @@ export class SelectionController extends EventTarget {
|
|||||||
*/
|
*/
|
||||||
insertParagraph() {
|
insertParagraph() {
|
||||||
if (this.isParagraphEnd) {
|
if (this.isParagraphEnd) {
|
||||||
|
console.log('a')
|
||||||
return this.insertParagraphAfter();
|
return this.insertParagraphAfter();
|
||||||
} else if (this.isParagraphStart) {
|
} else if (this.isParagraphStart) {
|
||||||
|
console.log('b')
|
||||||
return this.insertParagraphBefore();
|
return this.insertParagraphBefore();
|
||||||
}
|
}
|
||||||
|
console.log('c')
|
||||||
return this.splitParagraph();
|
return this.splitParagraph();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user