From 419a3910cfe360e47cd9a7a4e6d1aceb88289381 Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Fri, 24 Jan 2025 16:24:45 +0300 Subject: [PATCH 1/4] bug(tabulator): fix backspace with selection - backspace with selection deletes selection --- src/ListTabulator/index.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ListTabulator/index.ts b/src/ListTabulator/index.ts index 35f0b6f..a23236f 100644 --- a/src/ListTabulator/index.ts +++ b/src/ListTabulator/index.ts @@ -533,6 +533,14 @@ export default class ListTabulator { return; } + /** + * Caret is at start of input in case of delete selection + * Then backspace should be handled as usual + */ + if ((isCaretAtStartOfInput(currentItem) && window.getSelection()?.isCollapsed === false)) { + return; + } + /** * Prevent Editor.js backspace handling */ From 39c87d20588bc943a9dd33b2129432529d31b253 Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Fri, 24 Jan 2025 16:31:10 +0300 Subject: [PATCH 2/4] remove redundant condition --- src/ListTabulator/index.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ListTabulator/index.ts b/src/ListTabulator/index.ts index a23236f..d62acb2 100644 --- a/src/ListTabulator/index.ts +++ b/src/ListTabulator/index.ts @@ -534,10 +534,9 @@ export default class ListTabulator { } /** - * Caret is at start of input in case of delete selection - * Then backspace should be handled as usual + * If backspace is pressed with selection, it should be handled as usual */ - if ((isCaretAtStartOfInput(currentItem) && window.getSelection()?.isCollapsed === false)) { + if (window.getSelection()?.isCollapsed === false) { return; } From 416b21ca734fd861bc88603866eba9a44371e26d Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Fri, 24 Jan 2025 16:44:42 +0300 Subject: [PATCH 3/4] chore(): bump package version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2dad172..59465f8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@editorjs/list", - "version": "2.0.1", + "version": "2.0.2", "keywords": [ "codex editor", "list", From 256e8e77853a1b12dd58db4e0704d289e5f7e3a1 Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Fri, 24 Jan 2025 16:45:46 +0300 Subject: [PATCH 4/4] chore(): bump package version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 59465f8..6bcb7ee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@editorjs/list", - "version": "2.0.2", + "version": "2.0.4", "keywords": [ "codex editor", "list",