Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@ export class BlockMenuView {
.BNUpdateBlock(newBlockContentPos, { type: "paragraph", props: {} })
.setTextSelection(newBlockContentPos)
.run();
} else {
this.editor.commands.setTextSelection(endPos);
}

// Focuses and activates the suggestion menu.
Expand Down
8 changes: 8 additions & 0 deletions tests/end-to-end/draghandle/draghandle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ test.describe("Check Draghandle functionality", () => {
await page.waitForSelector(DRAG_HANDLE_ADD_SELECTOR, { state: "detached" });
});

test("Click add button for non-selected empty block", async () => {
await executeSlashCommand(page, "h1");
await page.keyboard.type("Heading 1");
await hoverAndAddBlockFromDragHandle(page, PARAGRAPH_SELECTOR, "h1");

await compareDocToSnapshot(page, "addnonselectedemptyblock");
});

test("Clicking delete button should delete block", async () => {
await executeSlashCommand(page, "h1");
await page.keyboard.type("Hover over this text");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"type": "doc",
"content": [
{
"type": "blockGroup",
"content": [
{
"type": "blockContainer",
"attrs": {
"id": 0,
"textColor": "default",
"backgroundColor": "default"
},
"content": [
{
"type": "heading",
"attrs": {
"textAlignment": "left",
"level": "1"
},
"content": [
{
"type": "text",
"text": "Heading 1"
}
]
}
]
},
{
"type": "blockContainer",
"attrs": {
"id": 1,
"textColor": "default",
"backgroundColor": "default"
},
"content": [
{
"type": "heading",
"attrs": {
"textAlignment": "left",
"level": "1"
}
}
]
},
{
"type": "blockContainer",
"attrs": {
"id": 2,
"textColor": "default",
"backgroundColor": "default"
},
"content": [
{
"type": "paragraph",
"attrs": {
"textAlignment": "left"
}
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"type": "doc",
"content": [
{
"type": "blockGroup",
"content": [
{
"type": "blockContainer",
"attrs": {
"id": 0,
"textColor": "default",
"backgroundColor": "default"
},
"content": [
{
"type": "heading",
"attrs": {
"textAlignment": "left",
"level": "1"
},
"content": [
{
"type": "text",
"text": "Heading 1"
}
]
}
]
},
{
"type": "blockContainer",
"attrs": {
"id": 1,
"textColor": "default",
"backgroundColor": "default"
},
"content": [
{
"type": "heading",
"attrs": {
"textAlignment": "left",
"level": "1"
}
}
]
},
{
"type": "blockContainer",
"attrs": {
"id": 2,
"textColor": "default",
"backgroundColor": "default"
},
"content": [
{
"type": "paragraph",
"attrs": {
"textAlignment": "left"
}
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"type": "doc",
"content": [
{
"type": "blockGroup",
"content": [
{
"type": "blockContainer",
"attrs": {
"id": 0,
"textColor": "default",
"backgroundColor": "default"
},
"content": [
{
"type": "heading",
"attrs": {
"textAlignment": "left",
"level": "1"
},
"content": [
{
"type": "text",
"text": "Heading 1"
}
]
}
]
},
{
"type": "blockContainer",
"attrs": {
"id": 1,
"textColor": "default",
"backgroundColor": "default"
},
"content": [
{
"type": "heading",
"attrs": {
"textAlignment": "left",
"level": "1"
}
}
]
},
{
"type": "blockContainer",
"attrs": {
"id": 2,
"textColor": "default",
"backgroundColor": "default"
},
"content": [
{
"type": "paragraph",
"attrs": {
"textAlignment": "left"
}
}
]
}
]
}
]
}