Skip to content

Commit

Permalink
Merge pull request #132 from editor-js/fix-backspace-with-selection
Browse files Browse the repository at this point in the history
bug(tabulator): fix backspace with selection
  • Loading branch information
e11sy authored Jan 24, 2025
2 parents ca0357c + 3a1b309 commit 0b83f3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@editorjs/list",
"version": "2.0.3",
"version": "2.0.4",
"keywords": [
"codex editor",
"list",
Expand Down
7 changes: 7 additions & 0 deletions src/ListTabulator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,13 @@ export default class ListTabulator<Renderer extends ListRenderer> {
return;
}

/**
* If backspace is pressed with selection, it should be handled as usual
*/
if (window.getSelection()?.isCollapsed === false) {
return;
}

/**
* Prevent Editor.js backspace handling
*/
Expand Down

0 comments on commit 0b83f3f

Please sign in to comment.